nfs-ganesha 1.4

fsal_convert.h

Go to the documentation of this file.
00001 
00010 #ifndef _FSAL_CONVERTION_H
00011 #define _FSAL_CONVERTION_H
00012 
00013 #include "fsal.h"
00014 
00015 /* convert error codes */
00016 int hpss2fsal_error(int hpss_errorcode);
00017 
00019 int fsal2hpss_openflags(fsal_openflags_t fsal_flags, int *p_hpss_flags);
00020 
00022 int fsal2hpss_testperm(fsal_accessflags_t testperm);
00023 
00024 /* Fills an FSAL attributes struct
00025  * using hpss handle and hpss attributes.
00026  */
00027 fsal_status_t hpss2fsal_attributes(ns_ObjHandle_t * p_hpss_handle_in,
00028                                    hpss_Attrs_t * p_hpss_attr_in,
00029                                    fsal_attrib_list_t * p_fsalattr_out);
00030 
00031 /*
00032  * 
00033  */
00034 fsal_status_t hpssHandle2fsalAttributes(ns_ObjHandle_t * p_hpsshandle_in,
00035                                         fsal_attrib_list_t * p_fsalattr_out);
00036 
00038 fsal_accessmode_t hpss2fsal_mode(unsigned32 uid_bit,
00039                                  unsigned32 gid_bit,
00040                                  unsigned32 sticky_bit,
00041                                  unsigned32 user_perms,
00042                                  unsigned32 group_perms, unsigned32 other_perms);
00043 
00045 void fsal2hpss_mode(fsal_accessmode_t fsal_mode,
00046 #if HPSS_MAJOR_VERSION < 7
00047                     unsigned32 * uid_bit, unsigned32 * gid_bit, unsigned32 * sticky_bit,
00048 #else
00049                     unsigned32 * mode_perms,
00050 #endif
00051                     unsigned32 * user_perms,
00052                     unsigned32 * group_perms, unsigned32 * other_perms);
00053 
00055 mode_t fsal2unix_mode(fsal_accessmode_t fsal_mode);
00056 
00058 fsal_accessmode_t unix2fsal_mode(mode_t unix_mode);
00059 
00061 fsal_nodetype_t hpss2fsal_type(unsigned32 hpss_type_in);
00062 
00064 fsal_u64_t hpss2fsal_64(u_signed64 hpss_size_in);
00065 
00067 u_signed64 fsal2hpss_64(fsal_u64_t fsal_size_in);
00068 
00070 fsal_fsid_t hpss2fsal_fsid(u_signed64 hpss_fsid_in);
00071 
00073 fsal_status_t fsal2hpss_attribset(fsal_handle_t * p_fsal_handle,
00074                                   fsal_attrib_list_t * p_attrib_set,
00075                                   hpss_fileattrbits_t * p_hpss_attrmask,
00076                                   hpss_Attrs_t * p_hpss_attrs);
00077 
00083 fsal_time_t hpss2fsal_time(timestamp_sec_t tsec);
00084 
00090 #define fsal2hpss_time(_time_) ((timestamp_sec_t)(_time_).seconds)
00091 
00092 #endif