nfs-ganesha 1.4

fsal_convert.h

Go to the documentation of this file.
00001 /*
00002  * vim:expandtab:shiftwidth=8:tabstop=8:
00003  *
00004  * Copyright CEA/DAM/DIF  (2008)
00005  * contributeur : Philippe DENIEL   philippe.deniel@cea.fr
00006  *                Thomas LEIBOVICI  thomas.leibovici@cea.fr
00007  *
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 3 of the License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  *
00023  * ---------------------------------------
00024  */
00025 
00033 #ifndef _FSAL_CONVERTION_H
00034 #define _FSAL_CONVERTION_H
00035 
00036 #include "fsal.h"
00037 
00038 /* convert error codes */
00039 int posix2fsal_error(int posix_errorcode);
00040 
00042 int fsal2posix_openflags(fsal_openflags_t fsal_flags, int *p_posix_flags);
00043 
00045 int fsal2posix_testperm(fsal_accessflags_t testperm);
00046 
00050 fsal_status_t posix2fsal_attributes(struct stat *p_buffstat,
00051                                     fsal_attrib_list_t * p_fsalattr_out);
00052 
00054 mode_t fsal2unix_mode(fsal_accessmode_t fsal_mode);
00055 
00057 fsal_accessmode_t unix2fsal_mode(mode_t unix_mode);
00058 
00060 fsal_nodetype_t posix2fsal_type(mode_t posix_type_in);
00061 
00063 fsal_fsid_t posix2fsal_fsid(dev_t posix_devid);
00064 
00070 fsal_time_t posix2fsal_time(time_t tsec);
00071 
00077 #define fsal2posix_time(_time_) ((time_t)(_time_).seconds)
00078 
00079 #define high32m( a ) ( (unsigned int)( a >> 32 ) )
00080 #define low32m( a ) ( (unsigned int)a )
00081 
00082 int stat2fsal_fh(struct ceph_mount_info *cmount,
00083                  struct stat *st,
00084                  cephfsal_handle_t* handle);
00085 
00086 #endif
00087 
00088