nfs-ganesha 1.4

fsal_compat.c

Go to the documentation of this file.
00001 /*
00002  * vim:expandtab:shiftwidth=4:tabstop=4:
00003  */
00004 
00010 #ifdef HAVE_CONFIG_H
00011 #include "config.h"
00012 #endif
00013 
00014 #include "fsal_types.h"
00015 #include "fsal_glue.h"
00016 #include "fsal_internal.h"
00017 #include "FSAL/common_methods.h"
00018 
00019 #ifdef _PNFS
00020 #include "fsal_pnfs.h"
00021 #endif /* _PNFS */
00022 
00023 fsal_functions_t fsal_lustre_functions = {
00024   .fsal_access = LUSTREFSAL_access,
00025   .fsal_getattrs = LUSTREFSAL_getattrs,
00026   .fsal_setattrs = LUSTREFSAL_setattrs,
00027   .fsal_buildexportcontext = LUSTREFSAL_BuildExportContext,
00028   .fsal_cleanupexportcontext = COMMON_CleanUpExportContext_noerror,
00029   .fsal_initclientcontext = COMMON_InitClientContext,
00030   .fsal_getclientcontext = COMMON_GetClientContext,
00031   .fsal_create = LUSTREFSAL_create,
00032   .fsal_mkdir = LUSTREFSAL_mkdir,
00033   .fsal_link = LUSTREFSAL_link,
00034   .fsal_mknode = LUSTREFSAL_mknode,
00035   .fsal_opendir = LUSTREFSAL_opendir,
00036   .fsal_readdir = LUSTREFSAL_readdir,
00037   .fsal_closedir = LUSTREFSAL_closedir,
00038   .fsal_open_by_name = LUSTREFSAL_open_by_name,
00039   .fsal_open = LUSTREFSAL_open,
00040   .fsal_read = LUSTREFSAL_read,
00041   .fsal_write = LUSTREFSAL_write,
00042   .fsal_commit = LUSTREFSAL_commit,
00043   .fsal_close = LUSTREFSAL_close,
00044   .fsal_open_by_fileid = COMMON_open_by_fileid,
00045   .fsal_close_by_fileid = COMMON_close_by_fileid,
00046   .fsal_dynamic_fsinfo = LUSTREFSAL_dynamic_fsinfo,
00047   .fsal_init = LUSTREFSAL_Init,
00048   .fsal_terminate = COMMON_terminate_noerror,
00049   .fsal_test_access = LUSTREFSAL_test_access,
00050   .fsal_setattr_access = COMMON_setattr_access_notsupp,
00051   .fsal_rename_access = COMMON_rename_access,
00052   .fsal_create_access = COMMON_create_access,
00053   .fsal_unlink_access = COMMON_unlink_access,
00054   .fsal_link_access = COMMON_link_access,
00055   .fsal_merge_attrs = COMMON_merge_attrs,
00056   .fsal_lock_op = LUSTREFSAL_lock_op,
00057   .fsal_lookup = LUSTREFSAL_lookup,
00058   .fsal_lookuppath = LUSTREFSAL_lookupPath,
00059   .fsal_lookupjunction = LUSTREFSAL_lookupJunction,
00060   .fsal_cleanobjectresources = COMMON_CleanObjectResources,
00061   .fsal_set_quota = LUSTREFSAL_set_quota,
00062   .fsal_get_quota = LUSTREFSAL_get_quota,
00063   .fsal_check_quota = LUSTREFSAL_check_quota,
00064   .fsal_rcp = LUSTREFSAL_rcp,
00065   .fsal_rename = LUSTREFSAL_rename,
00066   .fsal_get_stats = LUSTREFSAL_get_stats,
00067   .fsal_readlink = LUSTREFSAL_readlink,
00068   .fsal_symlink = LUSTREFSAL_symlink,
00069   .fsal_handlecmp = LUSTREFSAL_handlecmp,
00070   .fsal_handle_to_hashindex = LUSTREFSAL_Handle_to_HashIndex,
00071   .fsal_handle_to_rbtindex = LUSTREFSAL_Handle_to_RBTIndex,
00072   .fsal_handle_to_hash_both = NULL, 
00073   .fsal_digesthandle = LUSTREFSAL_DigestHandle,
00074   .fsal_expandhandle = LUSTREFSAL_ExpandHandle,
00075   .fsal_setdefault_fsal_parameter = COMMON_SetDefault_FSAL_parameter,
00076   .fsal_setdefault_fs_common_parameter = COMMON_SetDefault_FS_common_parameter,
00077   .fsal_setdefault_fs_specific_parameter =
00078       LUSTREFSAL_SetDefault_FS_specific_parameter,
00079   .fsal_load_fsal_parameter_from_conf = COMMON_load_FSAL_parameter_from_conf,
00080   .fsal_load_fs_common_parameter_from_conf =
00081       COMMON_load_FS_common_parameter_from_conf,
00082   .fsal_load_fs_specific_parameter_from_conf =
00083       LUSTREFSAL_load_FS_specific_parameter_from_conf,
00084   .fsal_truncate = LUSTREFSAL_truncate,
00085   .fsal_unlink = LUSTREFSAL_unlink,
00086   .fsal_getfsname = LUSTREFSAL_GetFSName,
00087   .fsal_getxattrattrs = LUSTREFSAL_GetXAttrAttrs,
00088   .fsal_listxattrs = LUSTREFSAL_ListXAttrs,
00089   .fsal_getxattrvaluebyid = LUSTREFSAL_GetXAttrValueById,
00090   .fsal_getxattridbyname = LUSTREFSAL_GetXAttrIdByName,
00091   .fsal_getxattrvaluebyname = LUSTREFSAL_GetXAttrValueByName,
00092   .fsal_setxattrvalue = LUSTREFSAL_SetXAttrValue,
00093   .fsal_setxattrvaluebyid = LUSTREFSAL_SetXAttrValueById,
00094   .fsal_removexattrbyid = LUSTREFSAL_RemoveXAttrById,
00095   .fsal_removexattrbyname = LUSTREFSAL_RemoveXAttrByName,
00096   .fsal_getextattrs = COMMON_getextattrs_notsupp,
00097   .fsal_getfileno = LUSTREFSAL_GetFileno,
00098   .fsal_share_op = COMMON_share_op_notsupp
00099 };
00100 
00101 fsal_const_t fsal_lustre_consts = {
00102   .fsal_handle_t_size = sizeof(lustrefsal_handle_t),
00103   .fsal_op_context_t_size = sizeof(lustrefsal_op_context_t),
00104   .fsal_export_context_t_size = sizeof(lustrefsal_export_context_t),
00105   .fsal_file_t_size = sizeof(lustrefsal_file_t),
00106   .fsal_cookie_t_size = sizeof(lustrefsal_cookie_t),
00107   .fsal_cred_t_size = sizeof(struct user_credentials),
00108   .fs_specific_initinfo_t_size = sizeof(lustrefs_specific_initinfo_t),
00109   .fsal_dir_t_size = sizeof(lustrefsal_dir_t)
00110 };
00111 
00112 fsal_functions_t FSAL_GetFunctions(void)
00113 {
00114   return fsal_lustre_functions;
00115 }                               /* FSAL_GetFunctions */
00116 
00117 fsal_const_t FSAL_GetConsts(void)
00118 {
00119   return fsal_lustre_consts;
00120 }                               /* FSAL_GetConsts */
00121 
00122 #ifdef _PNFS_MDS
00123 fsal_mdsfunctions_t fsal_lustre_mdsfunctions = {
00124   .layoutget = LUSTREFSAL_layoutget,
00125   .layoutreturn = LUSTREFSAL_layoutreturn,
00126   .layoutcommit = LUSTREFSAL_layoutcommit,
00127   .getdeviceinfo = LUSTREFSAL_getdeviceinfo,
00128   .getdevicelist = LUSTREFSAL_getdevicelist
00129 };
00130 
00131 fsal_mdsfunctions_t FSAL_GetMDSFunctions(void)
00132 {
00133   return fsal_lustre_mdsfunctions;
00134 }
00135 #endif /* _PNFS_MDS */
00136 
00137 #ifdef _PNFS_DS
00138 fsal_dsfunctions_t fsal_lustre_dsfunctions = {
00139   .DS_read = LUSTREFSAL_DS_read,
00140   .DS_write = LUSTREFSAL_DS_write,
00141   .DS_commit = LUSTREFSAL_DS_commit
00142 };
00143 
00144 fsal_dsfunctions_t FSAL_GetDSFunctions(void)
00145 {
00146   return fsal_lustre_dsfunctions;
00147 }
00148 #endif /* _PNFS_DS */