nfs-ganesha 1.4
|
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 #include <sys/types.h> 00039 #include <sys/stat.h> 00040 #include <unistd.h> 00041 00042 /* convert error codes */ 00043 int posix2fsal_error(int posix_errorcode); 00044 00046 int fsal2posix_openflags(fsal_openflags_t fsal_flags, int *p_posix_flags); 00047 00049 int fsal2posix_testperm(fsal_accessflags_t testperm); 00050 00054 fsal_status_t posix2fsal_attributes(struct stat *p_buffstat, 00055 fsal_attrib_list_t * p_fsalattr_out); 00056 00058 mode_t fsal2unix_mode(fsal_accessmode_t fsal_mode); 00059 00061 fsal_accessmode_t unix2fsal_mode(mode_t unix_mode); 00062 00064 fsal_nodetype_t posix2fsal_type(mode_t posix_type_in); 00065 00067 fsal_fsid_t posix2fsal_fsid(dev_t posix_devid); 00068 00074 fsal_time_t posix2fsal_time(time_t tsec, time_t nsec); 00075 00081 #define fsal2posix_time(_time_) ((time_t)(_time_).seconds) 00082 00083 #define my_high32m( a ) ( (unsigned int)( a >> 32 ) ) 00084 #define my_low32m( a ) ( (unsigned int)a ) 00085 00086 #endif