nfs-ganesha 1.4
|
00001 /* 00002 * vim:expandtab:shiftwidth=8:tabstop=8: 00003 */ 00004 00014 #ifdef HAVE_CONFIG_H 00015 #include "config.h" 00016 #endif 00017 00018 #include "fsal.h" 00019 #include "fsal_internal.h" 00020 #include "fsal_convert.h" 00021 00056 fsal_status_t FSAL_access(fsal_handle_t * object_handle, /* IN */ 00057 fsal_op_context_t * p_context, /* IN */ 00058 fsal_accessflags_t access_type, /* IN */ 00059 fsal_attrib_list_t * object_attributes /* [ IN/OUT ] */ 00060 ) 00061 { 00062 00063 fsal_status_t st; 00064 00065 /* sanity checks. 00066 * note : object_attributes is optional in FSAL_access. 00067 */ 00068 if(!object_handle || !p_context) 00069 Return(ERR_FSAL_FAULT, 0, INDEX_FSAL_access); 00070 00071 /* >> convert your fsal access type to your FS access type << */ 00072 00073 TakeTokenFSCall(); 00074 00075 /* >> call to your FS access call << */ 00076 00077 ReleaseTokenFSCall(); 00078 00079 /* >> convert the returned code, an return it on error << */ 00080 00081 /* get attributes if object_attributes is not null. 00082 * If an error occures during getattr operation, 00083 * an error bit is set in the output structure. 00084 */ 00085 if(object_attributes) 00086 { 00087 fsal_status_t status; 00088 00089 status = FSAL_getattrs(object_handle, p_context, object_attributes); 00090 00091 /* on error, we set a special bit in the mask. */ 00092 if(FSAL_IS_ERROR(status)) 00093 { 00094 FSAL_CLEAR_MASK(object_attributes->asked_attributes); 00095 FSAL_SET_MASK(object_attributes->asked_attributes, FSAL_ATTR_RDATTR_ERR); 00096 } 00097 } 00098 00099 Return(ERR_FSAL_NO_ERROR, 0, INDEX_FSAL_access); 00100 00101 }