nfs-ganesha 1.4
Classes | Defines | Typedefs | Functions

fsal.h File Reference

File System Abstraction Layer interface. More...

#include <stddef.h>
#include "nlm_list.h"
#include "fsal_types.h"
#include "common_utils.h"

Go to the source code of this file.

Classes

struct  fsal_xattrent__
struct  fsal_functions__
struct  fsal_const__

Defines

#define BUILD_BUG_ON(condition)   ((void)sizeof(char[1 - 2*!!(condition)]))
#define FSAL_TEST_MASK(_attrib_mask_, _attr_const_)   ( (_attrib_mask_) & (_attr_const_) )
#define FSAL_SET_MASK(_attrib_mask_, _attr_const_)   ( (_attrib_mask_) |= (_attr_const_) )
#define FSAL_CLEAR_MASK(_attrib_mask_)   ( (_attrib_mask_) = 0LL )
#define FSAL_SET_INIT_INFO(_common_info_struct_, _field_name_,_field_behavior_, _value_)
#define FSAL_SET_INIT_DEFAULT(_common_info_struct_, _field_name_)
#define FSAL_SET_COOKIE_BEGINNING(cookie)   memset( (char *)&cookie, 0, sizeof( fsal_cookie_t ) )
#define FSAL_SET_COOKIE_BY_OFFSET(__cookie, __offset)   memcpy( (char *)&(__cookie.data), (char *)&__offset, sizeof( uint64_t ) )
#define FSAL_SET_POFFSET_BY_COOKIE(__cookie, __poffset)   memcpy( (char *)__poffset, (char *)&(__cookie.data), sizeof( uint64_t ) )
#define FSAL_GET_EXP_CTX(popctx)   (fsal_export_context_t *)(popctx->export_context)
#define Return(_code_, _minor_, _f_)
#define ReturnStatus(_st_, _f_)   Return( (_st_).major, (_st_).minor, _f_ )
#define ReturnCode(_code_, _minor_)
#define FSAL_IS_ERROR(_status_)   ( ! ( ( _status_ ).major == ERR_FSAL_NO_ERROR ) )
#define snprintHandle(target, tgt_size, p_handle)
#define snprintCookie(target, tgt_size, p_cookie)   snprintmem(target,tgt_size,(caddr_t)p_cookie,sizeof(fsal_cookie_t))
#define snprintAttrs(target, tgt_size, p_attrs)   snprintmem(target,tgt_size,(caddr_t)p_attrs,sizeof(fsal_attrib_list_t))
#define sscanHandle(p_handle, str_source)   sscanmem( (caddr_t)p_handle,sizeof(fsal_handle_t),str_source )
#define sscanCookie(p_cookie, str_source)   sscanmem( (caddr_t)p_cookie,sizeof(fsal_cookie_t),str_source )
#define sscanAttrs(p_attrs, str_source)   sscanmem( (caddr_t)p_attrs,sizeof(fsal_attrib_list_t),str_source )
#define XATTRS_READLIST_FROM_BEGINNING   (0)
#define FSAL_QCMD(cmd, type)   (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
#define FSAL_FILENO(pfile)   FSAL_GetFileno( pfile )

Typedefs

typedef struct fsal_xattrent__ fsal_xattrent_t
typedef struct fsal_functions__ fsal_functions_t
typedef struct fsal_const__ fsal_const_t

Functions

fsal_status_t FSAL_SetDefault_FSAL_parameter (fsal_parameter_t *out_parameter)
fsal_status_t FSAL_SetDefault_FS_common_parameter (fsal_parameter_t *out_parameter)
fsal_status_t FSAL_SetDefault_FS_specific_parameter (fsal_parameter_t *out_parameter)
fsal_status_t FSAL_load_FSAL_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)
fsal_status_t FSAL_load_FS_common_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)
fsal_status_t FSAL_load_FS_specific_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)
fsal_status_t FSAL_Init (fsal_parameter_t *init_info)
fsal_boolean_t fsal_is_retryable (fsal_status_t status)
fsal_status_t FSAL_str2name (const char *string, fsal_mdsize_t in_str_maxlen, fsal_name_t *name)
fsal_status_t FSAL_name2str (fsal_name_t *p_name, char *string, fsal_mdsize_t out_str_maxlen)
int FSAL_namecmp (const fsal_name_t *p_name1, const fsal_name_t *p_name2)
fsal_status_t FSAL_namecpy (fsal_name_t *p_tgt_name, fsal_name_t *p_src_name)
fsal_status_t FSAL_str2path (char *string, fsal_mdsize_t in_str_maxlen, fsal_path_t *p_path)
fsal_status_t FSAL_path2str (fsal_path_t *p_path, char *string, fsal_mdsize_t out_str_maxlen)
int FSAL_pathcmp (fsal_path_t *p_path1, fsal_path_t *p_path2)
fsal_status_t FSAL_pathcpy (fsal_path_t *p_tgt_path, fsal_path_t *p_src_path)
fsal_status_t FSAL_buffdesc2name (fsal_buffdesc_t *in_buf, fsal_name_t *out_name)
fsal_status_t FSAL_buffdesc2path (fsal_buffdesc_t *in_buf, fsal_path_t *out_path)
fsal_status_t FSAL_path2buffdesc (fsal_path_t *in_path, fsal_buffdesc_t *out_buff)
fsal_status_t FSAL_name2buffdesc (fsal_name_t *in_name, fsal_buffdesc_t *out_buff)
int FSAL_handlecmp (fsal_handle_t *handle1, fsal_handle_t *handle2, fsal_status_t *status)
unsigned int FSAL_Handle_to_HashIndex (fsal_handle_t *p_handle, unsigned int cookie, unsigned int alphabet_len, unsigned int index_size)
unsigned int FSAL_Handle_to_RBTIndex (fsal_handle_t *p_handle, unsigned int cookie)
unsigned int FSAL_Handle_to_Hash_both (fsal_handle_t *p_handle, unsigned int cookie, unsigned int alphabet_len, unsigned int index_size, unsigned int *phashval, unsigned int *prbtval)
fsal_status_t FSAL_DigestHandle (fsal_export_context_t *p_expcontext, fsal_digesttype_t output_type, fsal_handle_t *in_fsal_handle, struct fsal_handle_desc *fh_desc)
fsal_status_t FSAL_ExpandHandle (fsal_export_context_t *p_expcontext, fsal_digesttype_t in_type, struct fsal_handle_desc *fh_desc)
fsal_status_t FSAL_CleanObjectResources (fsal_handle_t *in_fsal_handle)
fsal_status_t FSAL_cookie_to_uint64 (fsal_handle_t *handle, fsal_op_context_t *context, fsal_cookie_t *cookie, uint64_t *data)
fsal_status_t FSAL_uint64_to_cookie (fsal_handle_t *handle, fsal_op_context_t *context, uint64_t *uint64, fsal_cookie_t *cookie)
fsal_status_t FSAL_get_cookieverf (fsal_handle_t *handle, fsal_op_context_t *context, uint64_t *verf)
fsal_status_t FSAL_BuildExportContext (fsal_export_context_t *p_export_context, fsal_path_t *p_export_path, char *fs_specific_options)
fsal_status_t FSAL_CleanUpExportContext (fsal_export_context_t *p_export_context)
fsal_status_t FSAL_InitClientContext (fsal_op_context_t *p_thr_context)
fsal_status_t FSAL_GetClientContext (fsal_op_context_t *p_thr_context, fsal_export_context_t *p_export_context, fsal_uid_t uid, fsal_gid_t gid, fsal_gid_t *alt_groups, fsal_count_t nb_alt_groups)
fsal_status_t FSAL_lookup (fsal_handle_t *parent_directory_handle, fsal_name_t *p_filename, fsal_op_context_t *p_context, fsal_handle_t *object_handle, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_lookupPath (fsal_path_t *p_path, fsal_op_context_t *p_context, fsal_handle_t *object_handle, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_lookupJunction (fsal_handle_t *p_junction_handle, fsal_op_context_t *p_context, fsal_handle_t *p_fsoot_handle, fsal_attrib_list_t *p_fsroot_attributes)
fsal_status_t FSAL_access (fsal_handle_t *object_handle, fsal_op_context_t *p_context, fsal_accessflags_t access_type, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_test_access (fsal_op_context_t *p_context, fsal_accessflags_t access_type, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_create (fsal_handle_t *parent_directory_handle, fsal_name_t *p_filename, fsal_op_context_t *p_context, fsal_accessmode_t accessmode, fsal_handle_t *object_handle, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_mkdir (fsal_handle_t *parent_directory_handle, fsal_name_t *p_dirname, fsal_op_context_t *p_context, fsal_accessmode_t accessmode, fsal_handle_t *object_handle, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_truncate (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_size_t length, fsal_file_t *file_descriptor, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_getattrs (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_getattrs_descriptor (fsal_file_t *p_file_descriptor, fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, fsal_attrib_list_t *p_object_attributes)
fsal_status_t FSAL_setattrs (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_attrib_list_t *attrib_set, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_getextattrs (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_extattrib_list_t *object_attributes)
fsal_status_t FSAL_link (fsal_handle_t *target_handle, fsal_handle_t *dir_handle, fsal_name_t *p_link_name, fsal_op_context_t *p_context, fsal_attrib_list_t *attributes)
fsal_status_t FSAL_opendir (fsal_handle_t *dir_handle, fsal_op_context_t *p_context, fsal_dir_t *dir_descriptor, fsal_attrib_list_t *dir_attributes)
fsal_status_t FSAL_readdir (fsal_dir_t *dir_descriptor, fsal_cookie_t start_position, fsal_attrib_mask_t get_attr_mask, fsal_mdsize_t buffersize, fsal_dirent_t *pdirent, fsal_cookie_t *end_position, fsal_count_t *nb_entries, fsal_boolean_t *end_of_dir)
fsal_status_t FSAL_closedir (fsal_dir_t *dir_descriptor)
fsal_status_t FSAL_open (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_openflags_t openflags, fsal_file_t *file_descriptor, fsal_attrib_list_t *file_attributes)
fsal_status_t FSAL_open_by_name (fsal_handle_t *dirhandle, fsal_name_t *filename, fsal_op_context_t *p_context, fsal_openflags_t openflags, fsal_file_t *file_descriptor, fsal_attrib_list_t *file_attributes)
fsal_status_t FSAL_open_by_fileid (fsal_handle_t *filehandle, fsal_u64_t fileid, fsal_op_context_t *p_context, fsal_openflags_t openflags, fsal_file_t *file_descriptor, fsal_attrib_list_t *file_attributes)
fsal_status_t FSAL_read (fsal_file_t *file_descriptor, fsal_seek_t *seek_descriptor, fsal_size_t buffer_size, caddr_t buffer, fsal_size_t *read_amount, fsal_boolean_t *end_of_file)
fsal_status_t FSAL_write (fsal_file_t *file_descriptor, fsal_op_context_t *p_context, fsal_seek_t *seek_descriptor, fsal_size_t buffer_size, caddr_t buffer, fsal_size_t *write_amount)
fsal_status_t FSAL_commit (fsal_file_t *file_descriptor, fsal_off_t offset, fsal_size_t size)
fsal_status_t FSAL_close (fsal_file_t *file_descriptor)
fsal_status_t FSAL_close_by_fileid (fsal_file_t *file_descriptor, fsal_u64_t fileid)
fsal_status_t FSAL_readlink (fsal_handle_t *linkhandle, fsal_op_context_t *p_context, fsal_path_t *p_link_content, fsal_attrib_list_t *link_attributes)
fsal_status_t FSAL_symlink (fsal_handle_t *parent_directory_handle, fsal_name_t *p_linkname, fsal_path_t *p_linkcontent, fsal_op_context_t *p_context, fsal_accessmode_t accessmode, fsal_handle_t *link_handle, fsal_attrib_list_t *link_attributes)
fsal_status_t FSAL_rename (fsal_handle_t *old_parentdir_handle, fsal_name_t *p_old_name, fsal_handle_t *new_parentdir_handle, fsal_name_t *p_new_name, fsal_op_context_t *p_context, fsal_attrib_list_t *src_dir_attributes, fsal_attrib_list_t *tgt_dir_attributes)
fsal_status_t FSAL_unlink (fsal_handle_t *parentdir_handle, fsal_name_t *p_object_name, fsal_op_context_t *p_context, fsal_attrib_list_t *parentdir_attributes)
fsal_status_t FSAL_mknode (fsal_handle_t *parentdir_handle, fsal_name_t *p_node_name, fsal_op_context_t *p_context, fsal_accessmode_t accessmode, fsal_nodetype_t nodetype, fsal_dev_t *dev, fsal_handle_t *p_object_handle, fsal_attrib_list_t *node_attributes)
fsal_status_t FSAL_dynamic_fsinfo (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_dynamicfsinfo_t *dynamicinfo)
fsal_status_t FSAL_rcp (fsal_handle_t *filehandle, fsal_op_context_t *p_context, fsal_path_t *p_local_path, fsal_rcpflag_t transfer_opt)
fsal_status_t FSAL_lock_op (fsal_file_t *p_file_descriptor, fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, void *p_owner, fsal_lock_op_t lock_op, fsal_lock_param_t request_lock, fsal_lock_param_t *conflicting_lock)
fsal_status_t FSAL_share_op (fsal_file_t *p_file_descriptor, fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, void *p_owner, fsal_share_param_t request_share)
fsal_status_t FSAL_terminate ()
fsal_status_t FSAL_ListXAttrs (fsal_handle_t *p_objecthandle, unsigned int cookie, fsal_op_context_t *p_context, fsal_xattrent_t *xattrs_tab, unsigned int xattrs_tabsize, unsigned int *p_nb_returned, int *end_of_list)
fsal_status_t FSAL_GetXAttrIdByName (fsal_handle_t *p_objecthandle, const fsal_name_t *xattr_name, fsal_op_context_t *p_context, unsigned int *pxattr_id)
fsal_status_t FSAL_GetXAttrValueByName (fsal_handle_t *p_objecthandle, const fsal_name_t *xattr_name, fsal_op_context_t *p_context, caddr_t buffer_addr, size_t buffer_size, size_t *p_output_size)
fsal_status_t FSAL_GetXAttrValueById (fsal_handle_t *p_objecthandle, unsigned int xattr_id, fsal_op_context_t *p_context, caddr_t buffer_addr, size_t buffer_size, size_t *p_output_size)
fsal_status_t FSAL_SetXAttrValue (fsal_handle_t *p_objecthandle, const fsal_name_t *xattr_name, fsal_op_context_t *p_context, caddr_t buffer_addr, size_t buffer_size, int create)
fsal_status_t FSAL_SetXAttrValueById (fsal_handle_t *p_objecthandle, unsigned int xattr_id, fsal_op_context_t *p_context, caddr_t buffer_addr, size_t buffer_size)
fsal_status_t FSAL_GetXAttrAttrs (fsal_handle_t *p_objecthandle, fsal_op_context_t *p_context, unsigned int xattr_id, fsal_attrib_list_t *p_attrs)
fsal_status_t FSAL_RemoveXAttrById (fsal_handle_t *p_objecthandle, fsal_op_context_t *p_context, unsigned int xattr_id)
fsal_status_t FSAL_RemoveXAttrByName (fsal_handle_t *p_objecthandle, fsal_op_context_t *p_context, const fsal_name_t *xattr_name)
void FSAL_get_stats (fsal_statistics_t *stats, fsal_boolean_t reset)
char * FSAL_GetFSName ()
fsal_status_t FSAL_get_quota (fsal_path_t *pfsal_path, int quota_type, fsal_uid_t fsal_uid, fsal_quota_t *pquota)
fsal_status_t FSAL_set_quota (fsal_path_t *pfsal_path, int quota_type, fsal_uid_t fsal_uid, fsal_quota_t *pquot, fsal_quota_t *presquot)
fsal_status_t FSAL_check_quota (char *path, fsal_quota_type_t quota_type, fsal_uid_t fsal_uid)
unsigned int FSAL_GetFileno (fsal_file_t *pfile)
mode_t fsal2unix_mode (fsal_accessmode_t fsal_mode)
fsal_dev_t posix2fsal_devt (dev_t posix_devid)
fsal_accessmode_t unix2fsal_mode (mode_t unix_mode)
fsal_status_t FSAL_setattr_access (fsal_op_context_t *p_context, fsal_attrib_list_t *candidate_attributes, fsal_attrib_list_t *object_attributes)
fsal_status_t FSAL_merge_attrs (fsal_attrib_list_t *pinit_attr, fsal_attrib_list_t *pnew_attr, fsal_attrib_list_t *presult_attr)
fsal_status_t FSAL_rename_access (fsal_op_context_t *pcontext, fsal_attrib_list_t *pattrsrc, fsal_attrib_list_t *pattrdest)
fsal_status_t FSAL_unlink_access (fsal_op_context_t *pcontext, fsal_attrib_list_t *pattr)
fsal_status_t FSAL_create_access (fsal_op_context_t *pcontext, fsal_attrib_list_t *pattr)
fsal_status_t FSAL_link_access (fsal_op_context_t *pcontext, fsal_attrib_list_t *pattr)
int FSAL_LoadLibrary (char *path)
fsal_functions_t FSAL_GetFunctions (void)
void FSAL_LoadFunctions (void)
fsal_const_t FSAL_GetConsts (void)
void FSAL_LoadConsts (void)

Detailed Description

File System Abstraction Layer interface.

Author:
Author:
leibovic
Date:
Date:
2006/02/17 13:41:01
Version:
Revision:
1.72

Definition in file fsal.h.


Define Documentation

#define BUILD_BUG_ON (   condition)    ((void)sizeof(char[1 - 2*!!(condition)]))

BUILD_BUG_ON - break compile if a condition is true. : the condition which the compiler should know is false.

If you have some code which relies on certain constants being equal, or other compile-time-evaluated condition, you should use BUILD_BUG_ON to detect if someone changes it.

The implementation uses gcc's reluctance to create a negative array, but gcc (as of 4.4) only emits that error for obvious cases (eg. not arguments to inline functions). So as a fallback we use the optimizer; if it can't prove the condition is false, it will cause a link error on the undefined "__build_bug_on_failed". This error message can be harder to track down though, hence the two different methods.

Blatantly stolen from kernel source, include/linux/kernel.h:651

Definition at line 60 of file fsal.h.

#define FSAL_CLEAR_MASK (   _attrib_mask_)    ( (_attrib_mask_) = 0LL )

this macro clears the attribute mask example : FSAL_CLEAR_MASK( attrib_list.asked_attributes )

Definition at line 99 of file fsal.h.

#define FSAL_FILENO (   pfile)    FSAL_GetFileno( pfile )

Definition at line 967 of file fsal.h.

#define FSAL_GET_EXP_CTX (   popctx)    (fsal_export_context_t *)(popctx->export_context)

Definition at line 152 of file fsal.h.

#define FSAL_IS_ERROR (   _status_)    ( ! ( ( _status_ ).major == ERR_FSAL_NO_ERROR ) )

Tests whether the returned status is errorneous. Example : if ( FSAL_IS_ERROR( status = FSAL_call(...) )){ printf("ERROR status = %d, %d\n", status.major,status.minor); }

Definition at line 254 of file fsal.h.

#define FSAL_QCMD (   cmd,
  type 
)    (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))

Definition at line 943 of file fsal.h.

#define FSAL_SET_COOKIE_BEGINNING (   cookie)    memset( (char *)&cookie, 0, sizeof( fsal_cookie_t ) )

This macro sets the cookie to its initial value

Definition at line 141 of file fsal.h.

#define FSAL_SET_COOKIE_BY_OFFSET (   __cookie,
  __offset 
)    memcpy( (char *)&(__cookie.data), (char *)&__offset, sizeof( uint64_t ) )

This macros manage conversion between directory offset and cookies BEWARE : this will probably bug with FSAL_SNMP

Definition at line 146 of file fsal.h.

#define FSAL_SET_INIT_DEFAULT (   _common_info_struct_,
  _field_name_ 
)
Value:
do {                                                         \
             _common_info_struct_.behaviors._field_name_             \
                = FSAL_INIT_FS_DEFAULT ;                             \
           } while (0)

This macro initializes the behavior for one parameter to default filesystem value. Examples : FSAL_SET_INIT_DEFAULT( parameter.fs_common_info , case_insensitive );

Definition at line 133 of file fsal.h.

#define FSAL_SET_INIT_INFO (   _common_info_struct_,
  _field_name_,
  _field_behavior_,
  _value_ 
)
Value:
do \
           {                                                        \
             _common_info_struct_.behaviors._field_name_ = _field_behavior_ ;\
             if ( _field_behavior_ != FSAL_INIT_FS_DEFAULT )        \
               _common_info_struct_.values._field_name_ = _value_ ; \
           } while (0)

This macro initializes init info behaviors and values. Examples : FSAL_SET_INIT_INFO( parameter.fs_common_info , maxfilesize , FSAL_INIT_MAX_LIMIT , 0x00000000FFFFFFFFLL );

FSAL_SET_INIT_INFO( parameter.fs_common_info , linksupport , FSAL_INIT_FORCEVALUE , FALSE );

Definition at line 120 of file fsal.h.

#define FSAL_SET_MASK (   _attrib_mask_,
  _attr_const_ 
)    ( (_attrib_mask_) |= (_attr_const_) )

this macro sets an attribute example : FSAL_SET_MASK( attrib_list.asked_attributes, FSAL_ATTR_CREATION )

Definition at line 92 of file fsal.h.

#define FSAL_SET_POFFSET_BY_COOKIE (   __cookie,
  __poffset 
)    memcpy( (char *)__poffset, (char *)&(__cookie.data), sizeof( uint64_t ) )

Definition at line 149 of file fsal.h.

#define FSAL_TEST_MASK (   _attrib_mask_,
  _attr_const_ 
)    ( (_attrib_mask_) & (_attr_const_) )

this macro tests if an attribute is set example : FSAL_TEST_MASK( attrib_list.supported_attributes, FSAL_ATTR_CREATION )

Definition at line 85 of file fsal.h.

#define Return (   _code_,
  _minor_,
  _f_ 
)
Value:
do {                                   \
               fsal_status_t _struct_status_ = FSAL_STATUS_NO_ERROR ;          \
               (_struct_status_).major = (_code_) ;                            \
               (_struct_status_).minor = (_minor_) ;                           \
               fsal_increment_nbcall( _f_,_struct_status_ );                   \
               if(isDebug(COMPONENT_FSAL))                                     \
                 {                                                             \
                   if((_struct_status_).major != ERR_FSAL_NO_ERROR)            \
                     LogDebug(COMPONENT_FSAL,                                  \
                       "%s returns (%s, %s, %d)",fsal_function_names[_f_],     \
                       label_fsal_err(_code_), msg_fsal_err(_code_), _minor_); \
                   else                                                        \
                     LogFullDebug(COMPONENT_FSAL,                              \
                       "%s returns (%s, %s, %d)",fsal_function_names[_f_],     \
                       label_fsal_err(_code_), msg_fsal_err(_code_), _minor_); \
                 }                                                             \
               return (_struct_status_);                                       \
              } while(0)

Return : Macro for returning from functions with trace and function call increment.

Definition at line 212 of file fsal.h.

#define ReturnCode (   _code_,
  _minor_ 
)
Value:
do {                               \
               fsal_status_t _struct_status_ = FSAL_STATUS_NO_ERROR ;\
               (_struct_status_).major = (_code_) ;          \
               (_struct_status_).minor = (_minor_) ;         \
               return (_struct_status_);                     \
              } while(0)

ReturnCode : Macro for returning a fsal_status_t without trace nor stats increment.

Definition at line 237 of file fsal.h.

#define ReturnStatus (   _st_,
  _f_ 
)    Return( (_st_).major, (_st_).minor, _f_ )

Definition at line 231 of file fsal.h.

#define snprintAttrs (   target,
  tgt_size,
  p_attrs 
)    snprintmem(target,tgt_size,(caddr_t)p_attrs,sizeof(fsal_attrib_list_t))

Definition at line 324 of file fsal.h.

#define snprintCookie (   target,
  tgt_size,
  p_cookie 
)    snprintmem(target,tgt_size,(caddr_t)p_cookie,sizeof(fsal_cookie_t))

Definition at line 321 of file fsal.h.

#define snprintHandle (   target,
  tgt_size,
  p_handle 
)
Value:
do {                                                           \
        struct fsal_handle_desc fd = {                           \
                .start = (char *)p_handle                        \
        };                                                       \
        FSAL_ExpandHandle(NULL, FSAL_DIGEST_SIZEOF, &fd);        \
        snprintmem(target,tgt_size,(caddr_t)p_handle,fd.len);    \
  } while(0)

Definition at line 312 of file fsal.h.

#define sscanAttrs (   p_attrs,
  str_source 
)    sscanmem( (caddr_t)p_attrs,sizeof(fsal_attrib_list_t),str_source )

Definition at line 333 of file fsal.h.

#define sscanCookie (   p_cookie,
  str_source 
)    sscanmem( (caddr_t)p_cookie,sizeof(fsal_cookie_t),str_source )

Definition at line 330 of file fsal.h.

#define sscanHandle (   p_handle,
  str_source 
)    sscanmem( (caddr_t)p_handle,sizeof(fsal_handle_t),str_source )

Definition at line 327 of file fsal.h.

#define XATTRS_READLIST_FROM_BEGINNING   (0)

cookie for reading attrs from the first one

Definition at line 773 of file fsal.h.


Typedef Documentation

typedef struct fsal_const__ fsal_const_t

An extented attribute entry


Function Documentation

mode_t fsal2unix_mode ( fsal_accessmode_t  fsal_mode)

fsal2unix_mode: Convert FSAL mode to posix mode.

Parameters:
fsal_mode(input): The FSAL mode to be translated.
Returns:
The posix mode associated to fsal_mode.

Definition at line 64 of file fsal_convert.c.

fsal_status_t FSAL_access ( fsal_handle_t object_handle,
fsal_op_context_t p_context,
fsal_accessflags_t  access_type,
fsal_attrib_list_t object_attributes 
)

FSAL_access : Tests whether the user or entity identified by the p_context structure can access the object identified by object_handle, as indicated by the access_type parameter.

Parameters:
object_handle(input): The handle of the object to test permissions on.
p_context(input): Authentication context for the operation (export entry, user,...).
access_type(input): Indicates the permissions to be tested. This is an inclusive OR of the permissions to be checked for the user specified by p_context. Permissions constants are :

  • FSAL_R_OK : test for read permission
  • FSAL_W_OK : test for write permission
  • FSAL_X_OK : test for exec permission
  • FSAL_F_OK : test for file existence
object_attributes(optional input/output): The post operation attributes for the object. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). Can be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error, asked permission is granted)
  • ERR_FSAL_ACCESS (object permissions doesn't fit asked access type)
  • ERR_FSAL_STALE (object_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes when something anormal occurs.

Definition at line 38 of file fsal_glue.c.

fsal_status_t FSAL_check_quota ( char *  path,
fsal_quota_type_t  quota_type,
fsal_uid_t  fsal_uid 
)

Definition at line 445 of file fsal_glue.c.

fsal_status_t FSAL_CleanObjectResources ( fsal_handle_t in_fsal_handle)

FSAL_CleanObjectResources: Garbages the resources relative to an fsal_handle_t.

FSAL_CleanObjectResources: This function cleans remanent internal resources that are kept for a given FSAL handle.

Parameters:
in_fsal_handle(input): The handle whose the resources are to be cleaned.

Definition at line 422 of file fsal_glue.c.

fsal_status_t FSAL_CleanUpExportContext ( fsal_export_context_t p_export_context)

Definition at line 90 of file fsal_glue.c.

fsal_status_t FSAL_close ( fsal_file_t file_descriptor)

FSAL_close: Free the resources allocated by the FSAL_open call.

Parameters:
file_descriptor(input): The file descriptor returned by FSAL_open.
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 307 of file fsal_glue.c.

fsal_status_t FSAL_close_by_fileid ( fsal_file_t file_descriptor,
fsal_u64_t  fileid 
)

Definition at line 323 of file fsal_glue.c.

fsal_status_t FSAL_closedir ( fsal_dir_t dir_descriptor)

FSAL_closedir : Free the resources allocated for reading directory entries.

Parameters:
dir_descriptor(input): Pointer to a directory descriptor filled by FSAL_opendir.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 251 of file fsal_glue.c.

fsal_status_t FSAL_commit ( fsal_file_t file_descriptor,
fsal_off_t  offset,
fsal_size_t  size 
)

Definition at line 300 of file fsal_glue.c.

fsal_status_t FSAL_cookie_to_uint64 ( fsal_handle_t handle,
fsal_op_context_t context,
fsal_cookie_t cookie,
uint64_t data 
)

FSAL_cookie_to_uint64

This function converts an fsal_cookie_t to a uint64_t value that can be supplied to NFS readdir routines.

Parameters:
[in]handleThe handle of the directory to which the cookie pertains
[in]contextThe FSAL operation context
[in]cookieThe directory entry cookie
[out]dataThe uint64_t value corresponding to the cookie

Definition at line 95 of file fsal_glue.c.

fsal_status_t FSAL_create ( fsal_handle_t parent_directory_handle,
fsal_name_t p_filename,
fsal_op_context_t p_context,
fsal_accessmode_t  accessmode,
fsal_handle_t object_handle,
fsal_attrib_list_t object_attributes 
)

FSAL_create: Create a regular file.

Parameters:
parent_directory_handle(input): Handle of the parent directory where the file is to be created.
p_filename(input): Pointer to the name of the file to be created.
cred(input): Authentication context for the operation (user, export...).
accessmode(input): Mode for the file to be created. (the umask defined into the FSAL configuration file will be applied on it).
object_handle(output): Pointer to the handle of the created file.
object_attributes(optionnal input/output): The postop attributes of the created file. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). Can be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (parent_directory_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_EXIST, ERR_FSAL_IO, ...

NB: if getting postop attributes failed, the function does not return an error but the FSAL_ATTR_RDATTR_ERR bit is set in the object_attributes->asked_attributes field.

Definition at line 183 of file fsal_glue.c.

fsal_status_t FSAL_create_access ( fsal_op_context_t pcontext,
fsal_attrib_list_t pattr 
)

FSAL_create_access : test if a client identified by cred can create an object within a directory knowing its attributes

Parameters:
pcontext(in fsal_cred_t *) user's context.
pattrsource directory attributes
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (Permission denied)
  • ERR_FSAL_FAULT (null pointer parameter)
  • ERR_FSAL_INVAL (missing attributes : mode, group, user,...)
  • ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 368 of file fsal_glue.c.

fsal_status_t FSAL_DigestHandle ( fsal_export_context_t p_expcontext,
fsal_digesttype_t  output_type,
fsal_handle_t in_fsal_handle,
struct fsal_handle_desc fh_desc 
)

FSAL_DigestHandle : convert an fsal_handle_t to a buffer to be included into NFS handles, or another digest.

Definition at line 537 of file fsal_glue.c.

fsal_status_t FSAL_dynamic_fsinfo ( fsal_handle_t filehandle,
fsal_op_context_t p_context,
fsal_dynamicfsinfo_t dynamicinfo 
)

FSAL_dynamic_fsinfo: Return dynamic filesystem info such as used size, free size, number of objects...

Parameters:
filehandle(input): Handle of an object in the filesystem whom info is to be retrieved.
p_context(input): Authentication context for the operation (user,...).
dynamicinfo(output): Pointer to the static info of the filesystem.
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 329 of file fsal_glue.c.

fsal_status_t FSAL_ExpandHandle ( fsal_export_context_t p_expcontext,
fsal_digesttype_t  in_type,
struct fsal_handle_desc fh_desc 
)

FSAL_ExpandHandle : convert a buffer extracted from NFS handles to an FSAL handle.

Definition at line 546 of file fsal_glue.c.

fsal_status_t FSAL_get_cookieverf ( fsal_handle_t handle,
fsal_op_context_t context,
uint64_t verf 
)

FSAL_get_cookieverf

This function retrieves a cookie verifier from the FSAL for a given directory.

Parameters:
[in]handleThe handle of the directory to which the verifier pertains
[in]contextThe FSAL operation context
[out]verfThe directory entry cookie

Definition at line 133 of file fsal_glue.c.

fsal_status_t FSAL_get_quota ( fsal_path_t pfsal_path,
int  quota_type,
fsal_uid_t  fsal_uid,
fsal_quota_t pquota 
)

FSAL_get_quota : Gets the quota for a given path.

Parameters:
pfsal_pathpath to the filesystem whose quota are requested
fsal_uiduid for the user whose quota are requested
pquota(input): Parameter to the structure containing the requested quotas
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • Another error code if an error occured.

Definition at line 437 of file fsal_glue.c.

void FSAL_get_stats ( fsal_statistics_t stats,
fsal_boolean_t  reset 
)

FSAL_get_stats: Retrieve call statistics for current thread.

Parameters:
stats(output): Pointer to the call statistics structure.
reset(input): Boolean that indicates if the stats must be reset.
Returns:
Nothing.

Definition at line 473 of file fsal_glue.c.

fsal_status_t FSAL_getattrs ( fsal_handle_t filehandle,
fsal_op_context_t p_context,
fsal_attrib_list_t object_attributes 
)

FSAL_getattrs: Get attributes for the object specified by its filehandle.

Parameters:
filehandle(input): The handle of the object to get parameters.
p_context(input): Authentication context for the operation (user, export...).
object_attributes(mandatory input/output): The retrieved attributes for the object. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains).
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (object_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Another error code if an error occured.

Definition at line 47 of file fsal_glue.c.

fsal_status_t FSAL_getattrs_descriptor ( fsal_file_t p_file_descriptor,
fsal_handle_t p_filehandle,
fsal_op_context_t p_context,
fsal_attrib_list_t p_object_attributes 
)

Definition at line 54 of file fsal_glue.c.

fsal_const_t FSAL_GetConsts ( void  )

Definition at line 134 of file FSAL_CEPH/fsal_compat.c.

fsal_status_t FSAL_getextattrs ( fsal_handle_t p_filehandle,
fsal_op_context_t p_context,
fsal_extattrib_list_t p_object_attributes 
)

FSAL_getetxattrs: Get attributes for the object specified by its filehandle.

Parameters:
filehandle(input): The handle of the object to get parameters.
cred(input): Authentication context for the operation (user,...).
object_attributes(mandatory input/output): The retrieved attributes for the object. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains).
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • Another error code if an error occured.

Definition at line 704 of file fsal_glue.c.

unsigned int FSAL_GetFileno ( fsal_file_t pfile)

Definition at line 699 of file fsal_glue.c.

char* FSAL_GetFSName ( )

Definition at line 607 of file fsal_glue.c.

fsal_functions_t FSAL_GetFunctions ( void  )

Definition at line 129 of file FSAL_CEPH/fsal_compat.c.

fsal_status_t FSAL_GetXAttrAttrs ( fsal_handle_t p_objecthandle,
fsal_op_context_t p_context,
unsigned int  xattr_id,
fsal_attrib_list_t p_attrs 
)

Get the attributes of an extended attribute from its index.

Parameters:
p_objecthandleHandle of the object you want to get attribute for.
p_contextpointer to the current security context.
xattr_cookiexattr's cookie (as returned by listxattrs).
p_attrsxattr's attributes.
Parameters:
p_attrsIN/OUT xattr attributes (if supported)

Definition at line 612 of file fsal_glue.c.

fsal_status_t FSAL_GetXAttrIdByName ( fsal_handle_t p_objecthandle,
const fsal_name_t xattr_name,
fsal_op_context_t p_context,
unsigned int *  pxattr_id 
)

Get the index of an xattr based on its name

Parameters:
p_objecthandleHandle of the object you want to get attribute for.
xattr_namethe name of the attribute to be read.
pxattr_idfound xattr_id
Returns:
ERR_FSAL_NO_ERROR if xattr_name exists, ERR_FSAL_NOENT otherwise

Definition at line 644 of file fsal_glue.c.

fsal_status_t FSAL_GetXAttrValueById ( fsal_handle_t p_objecthandle,
unsigned int  xattr_id,
fsal_op_context_t p_context,
caddr_t  buffer_addr,
size_t  buffer_size,
size_t *  p_output_size 
)

Get the value of an extended attribute from its index.

Parameters:
p_objecthandleHandle of the object you want to get attribute for.
xattr_namethe name of the attribute to be read.
p_contextpointer to the current security context.
buffer_addraddress of the buffer where the xattr value is to be stored.
buffer_sizesize of the buffer where the xattr value is to be stored.
p_output_sizesize of the data actually stored into the buffer.

Definition at line 633 of file fsal_glue.c.

fsal_status_t FSAL_GetXAttrValueByName ( fsal_handle_t p_objecthandle,
const fsal_name_t xattr_name,
fsal_op_context_t p_context,
caddr_t  buffer_addr,
size_t  buffer_size,
size_t *  p_output_size 
)

Get the value of an extended attribute from its name.

Parameters:
p_objecthandleHandle of the object you want to get attribute for.
xattr_namethe name of the attribute to be read.
p_contextpointer to the current security context.
buffer_addraddress of the buffer where the xattr value is to be stored.
buffer_sizesize of the buffer where the xattr value is to be stored.
p_output_sizesize of the data actually stored into the buffer.

Definition at line 653 of file fsal_glue.c.

unsigned int FSAL_Handle_to_Hash_both ( fsal_handle_t p_handle,
unsigned int  cookie,
unsigned int  alphabet_len,
unsigned int  index_size,
unsigned int *  phashval,
unsigned int *  prbtval 
)

FSAL_Handle_to_Hash_Both This function is used for generating both a RBT node ID and a hash index in one pass in order to identify entries into the RBT.

Parameters:
p_handleThe handle to be hashed
cookieMakes it possible to have different hash value for the same handle, when cookie changes.
alphabet_lenParameter for polynomial hashing algorithm
index_sizeThe range of hash value will be [0..index_size-1]
phashvalFirst computed value : hash value
prbtvalSecond computed value : rbt value
Returns:
1 if successful and 0 otherwise

Definition at line 520 of file fsal_glue.c.

unsigned int FSAL_Handle_to_HashIndex ( fsal_handle_t p_handle,
unsigned int  cookie,
unsigned int  alphabet_len,
unsigned int  index_size 
)

FSAL_Handle_to_HashIndex This function is used for hashing a FSAL handle in order to dispatch entries into the hash table array.

Parameters:
p_handleThe handle to be hashed
cookieMakes it possible to have different hash value for the same handle, when cookie changes.
alphabet_lenParameter for polynomial hashing algorithm
index_sizeThe range of hash value will be [0..index_size-1]
Returns:
The hash value

Definition at line 507 of file fsal_glue.c.

unsigned int FSAL_Handle_to_RBTIndex ( fsal_handle_t p_handle,
unsigned int  cookie 
)

FSAL_Handle_to_RBTIndex This function is used for generating a RBT node ID in order to identify entries into the RBT.

Parameters:
p_handleThe handle to be hashed
cookieMakes it possible to have different hash value for the same handle, when cookie changes.
Returns:
The hash value

Definition at line 515 of file fsal_glue.c.

int FSAL_handlecmp ( fsal_handle_t handle1,
fsal_handle_t handle2,
fsal_status_t status 
)

Compare 2 handles.

Returns:
- 0 if handle are the same
  • A non null value else.

FSAL_handlecmp: Compare 2 handles.

Parameters:
handle1(input): The first handle to be compared.
handle2(input): The second handle to be compared.
status(output): The status of the compare operation.
Returns:
- 0 if handles are the same.
  • A non null value else.
  • Segfault if status is a NULL pointer.

Definition at line 501 of file fsal_glue.c.

fsal_status_t FSAL_Init ( fsal_parameter_t init_info)

FSAL_Init: Initializes Filesystem abstraction layer.

FSAL_Init : Initializes the FileSystem Abstraction Layer.

Parameters:
init_info(input, fsal_parameter_t *) : Pointer to a structure that contains all initialization parameters for the FSAL. Specifically, it contains settings about the filesystem on which the FSAL is based, security settings, logging policy and outputs, and other general FSAL options.
Returns:
Major error codes : ERR_FSAL_NO_ERROR (initialisation OK) ERR_FSAL_FAULT (init_info pointer is null) ERR_FSAL_SERVERFAULT (misc FSAL error) ERR_FSAL_ALREADY_INIT (The FS is already initialized) ERR_FSAL_BAD_INIT (FS specific init error, minor error code gives the reason for this error.) ERR_FSAL_SEC_INIT (Security context init error).

Definition at line 336 of file fsal_glue.c.

fsal_boolean_t fsal_is_retryable ( fsal_status_t  status)

Tests whether an error code is retryable.

fsal_is_retryable: Indicates if an FSAL error is retryable, i.e. if the caller has a chance of succeeding if it tries to call again the function that returned such an error code.

Parameters:
status(input),:The fsal status whom retryability is to be tested.
Returns:
- TRUE if the error is retryable.
  • FALSE if the error is NOT retryable.

Todo:
: ERR_FSAL_DELAY : The only retryable error ?
Todo:
: ERR_FSAL_DELAY : The only retryable error ?
Todo:
: ERR_FSAL_DELAY : The only retryable error ?

Definition at line 33 of file FSAL_CEPH/fsal_errors.c.

fsal_status_t FSAL_link ( fsal_handle_t target_handle,
fsal_handle_t dir_handle,
fsal_name_t p_link_name,
fsal_op_context_t p_context,
fsal_attrib_list_t attributes 
)

FSAL_link: Create a hardlink.

Parameters:
target_handle(input): Handle of the target object.
dir_handle(input): Pointer to the directory handle where the hardlink is to be created.
p_link_name(input): Pointer to the name of the hardlink to be created.
cred(input): Authentication context for the operation (user,...).
accessmode(input): Mode for the directory to be created. (the umask defined into the FSAL configuration file will be applied on it).
attributes(optionnal input/output): The post_operation attributes of the linked object. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (target_handle or dir_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_EXIST, ERR_FSAL_IO, ...

NB: if getting postop attributes failed, the function does not return an error but the FSAL_ATTR_RDATTR_ERR bit is set in the attributes->asked_attributes field.

Definition at line 205 of file fsal_glue.c.

fsal_status_t FSAL_link_access ( fsal_op_context_t pcontext,
fsal_attrib_list_t pattr 
)

Definition at line 380 of file fsal_glue.c.

fsal_status_t FSAL_ListXAttrs ( fsal_handle_t p_objecthandle,
unsigned int  argcookie,
fsal_op_context_t p_context,
fsal_xattrent_t xattrs_tab,
unsigned int  xattrs_tabsize,
unsigned int *  p_nb_returned,
int *  end_of_list 
)

Retrieves the list of extended attributes for an object in the filesystem.

Parameters:
p_objecthandleHandle of the object we want to get extended attributes.
cookieindex of the next entry to be returned.
p_contextpointer to the current security context.
xattrs_taba table for storing extended attributes list to.
xattrs_tabsizethe maximum number of xattr entries that xattrs_tab can contain.
p_nb_returnedthe number of xattr entries actually stored in xattrs_tab.
end_of_listthis boolean indicates that the end of xattrs list has been reached.

Definition at line 620 of file fsal_glue.c.

fsal_status_t FSAL_load_FS_common_parameter_from_conf ( config_file_t  in_config,
fsal_parameter_t out_parameter 
)

Definition at line 574 of file fsal_glue.c.

fsal_status_t FSAL_load_FS_specific_parameter_from_conf ( config_file_t  in_config,
fsal_parameter_t out_parameter 
)

Definition at line 580 of file fsal_glue.c.

fsal_status_t FSAL_load_FSAL_parameter_from_conf ( config_file_t  in_config,
fsal_parameter_t out_parameter 
)

FSAL_load_FSAL_parameter_from_conf, FSAL_load_FS_common_parameter_from_conf, FSAL_load_FS_specific_parameter_from_conf:

Those functions initialize the FSAL init parameter structure from a configuration structure.

Parameters:
in_config(input): Structure that represents the parsed configuration file.
out_parameter(ouput) FSAL initialization structure filled according to the configuration file given as parameter.
Returns:
ERR_FSAL_NO_ERROR (no error) , ERR_FSAL_NOENT (missing a mandatory stanza in config file), ERR_FSAL_INVAL (invalid parameter), ERR_FSAL_SERVERFAULT (unexpected error) ERR_FSAL_FAULT (null pointer given as parameter),

Definition at line 568 of file fsal_glue.c.

void FSAL_LoadConsts ( void  )

Definition at line 791 of file fsal_glue.c.

void FSAL_LoadFunctions ( void  )

Definition at line 786 of file fsal_glue.c.

int FSAL_LoadLibrary ( char *  path)

Definition at line 781 of file fsal_glue.c.

fsal_status_t FSAL_lock_op ( fsal_file_t p_file_descriptor,
fsal_handle_t p_filehandle,
fsal_op_context_t p_context,
void *  p_owner,
fsal_lock_op_t  lock_op,
fsal_lock_param_t  request_lock,
fsal_lock_param_t conflicting_lock 
)

Definition at line 711 of file fsal_glue.c.

fsal_status_t FSAL_lookup ( fsal_handle_t parent_directory_handle,
fsal_name_t p_filename,
fsal_op_context_t p_context,
fsal_handle_t object_handle,
fsal_attrib_list_t object_attributes 
)

FSAL_lookup : Looks up for an object into a directory.

Note : if parent handle and filename are NULL, this retrieves root's handle.

Parameters:
parent_directory_handle(input) Handle of the parent directory to search the object in.
filename(input) The name of the object to find.
p_context(input) Authentication context for the operation (user,...).
object_handle(output) The handle of the object corresponding to filename.
object_attributes(optional input/output) Pointer to the attributes of the object we found. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). It can be NULL (increases performances).
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (parent_directory_handle does not address an existing object)
  • ERR_FSAL_NOTDIR (parent_directory_handle does not address a directory)
  • ERR_FSAL_NOENT (the object designated by p_filename does not exist)
  • ERR_FSAL_XDEV (tried to operate a lookup on a filesystem junction. Use FSAL_lookupJunction instead)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 393 of file fsal_glue.c.

fsal_status_t FSAL_lookupJunction ( fsal_handle_t p_junction_handle,
fsal_op_context_t p_context,
fsal_handle_t p_fsoot_handle,
fsal_attrib_list_t p_fsroot_attributes 
)

FSAL_lookupJunction : Get the fileset root for a junction.

Parameters:
p_junction_handle(input) Handle of the junction to be looked up.
cred(input) Authentication context for the operation (user,...).
p_fsroot_handle(output) The handle of root directory of the fileset.
p_fsroot_attributes(optional input/output) Pointer to the attributes of the root directory for the fileset. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). It can be NULL (increases performances).
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (p_junction_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 412 of file fsal_glue.c.

fsal_status_t FSAL_lookupPath ( fsal_path_t p_path,
fsal_op_context_t p_context,
fsal_handle_t object_handle,
fsal_attrib_list_t object_attributes 
)

FSAL_lookupPath : Looks up for an object into the namespace.

Note : if path equals "/", this retrieves root's handle.

Parameters:
path(input) The path of the object to find.
p_context(input) Authentication context for the operation (user,...).
object_handle(output) The handle of the object corresponding to filename.
object_attributes(optional input/output) Pointer to the attributes of the object we found. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). It can be NULL (increases performances).
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • ERR_FSAL_INVAL (the path argument is not absolute)
  • ERR_FSAL_NOENT (an element in the path does not exist)
  • ERR_FSAL_NOTDIR (an element in the path is not a directory)
  • ERR_FSAL_XDEV (tried to cross a filesystem junction, whereas is has not been authorized in the server configuration - FSAL::auth_xdev_export parameter)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 403 of file fsal_glue.c.

fsal_status_t FSAL_merge_attrs ( fsal_attrib_list_t pinit_attr,
fsal_attrib_list_t pnew_attr,
fsal_attrib_list_t presult_attr 
)

FSAL_merge_attrs: merge to attributes structure.

This functions merge the second attributes list into the first argument. Results in returned in the last argument.

Parameters:
pinit_attr[IN] attributes to be changed
pnew_attr[IN] attributes to be added
presult_attr[IN] resulting attributes
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_INVAL Invalid argument(s)

Definition at line 386 of file fsal_glue.c.

fsal_status_t FSAL_mkdir ( fsal_handle_t parent_directory_handle,
fsal_name_t p_dirname,
fsal_op_context_t p_context,
fsal_accessmode_t  accessmode,
fsal_handle_t object_handle,
fsal_attrib_list_t object_attributes 
)

FSAL_mkdir: Create a directory.

Parameters:
parent_directory_handle(input): Handle of the parent directory where the subdirectory is to be created.
p_dirname(input): Pointer to the name of the directory to be created.
cred(input): Authentication context for the operation (user,...).
accessmode(input): Mode for the directory to be created. (the umask defined into the FSAL configuration file will be applied on it).
object_handle(output): Pointer to the handle of the created directory.
object_attributes(optionnal input/output): The attributes of the created directory. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (parent_directory_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_EXIST, ERR_FSAL_IO, ...

NB: if getting postop attributes failed, the function does not return an error but the FSAL_ATTR_RDATTR_ERR bit is set in the object_attributes->asked_attributes field.

Definition at line 194 of file fsal_glue.c.

fsal_status_t FSAL_mknode ( fsal_handle_t parentdir_handle,
fsal_name_t p_node_name,
fsal_op_context_t p_context,
fsal_accessmode_t  accessmode,
fsal_nodetype_t  nodetype,
fsal_dev_t dev,
fsal_handle_t p_object_handle,
fsal_attrib_list_t node_attributes 
)

FSAL_mknode: Create a special object in the filesystem. Not supported in upper layers in this GANESHA's version.

Returns:
ERR_FSAL_NOTSUPP.

Definition at line 215 of file fsal_glue.c.

fsal_status_t FSAL_open ( fsal_handle_t filehandle,
fsal_op_context_t p_context,
fsal_openflags_t  openflags,
fsal_file_t file_descriptor,
fsal_attrib_list_t file_attributes 
)

FSAL_open: Open a regular file for reading/writing its data content.

Parameters:
filehandle(input): Handle of the file to be read/modified.
cred(input): Authentication context for the operation (user,...).
openflags(input): Flags that indicates behavior for file opening and access. This is an inclusive OR of the following values ( such of them are not compatible) :

  • FSAL_O_RDONLY: opening file for reading only.
  • FSAL_O_RDWR: opening file for reading and writing.
  • FSAL_O_WRONLY: opening file for writting only.
  • FSAL_O_APPEND: always write at the end of the file.
  • FSAL_O_TRUNC: truncate the file to 0 on opening.
file_descriptor(output): The file descriptor to be used for FSAL_read/write operations.
file_attributes(optionnal input/output): Post operation attributes. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains).
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (user doesn't have the permissions for opening the file)
  • ERR_FSAL_STALE (filehandle does not address an existing object)
  • ERR_FSAL_INVAL (filehandle does not address a regular file, or open flags are conflicting)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 267 of file fsal_glue.c.

fsal_status_t FSAL_open_by_fileid ( fsal_handle_t filehandle,
fsal_u64_t  fileid,
fsal_op_context_t p_context,
fsal_openflags_t  openflags,
fsal_file_t file_descriptor,
fsal_attrib_list_t file_attributes 
)

Definition at line 312 of file fsal_glue.c.

fsal_status_t FSAL_open_by_name ( fsal_handle_t dirhandle,
fsal_name_t filename,
fsal_op_context_t p_context,
fsal_openflags_t  openflags,
fsal_file_t file_descriptor,
fsal_attrib_list_t file_attributes 
)

FSAL_open_byname: Open a regular file for reading/writing its data content.

Parameters:
dirhandle(input): Handle of the directory that contain the file to be read/modified.
filename(input): Name of the file to be read/modified
cred(input): Authentication context for the operation (user,...).
openflags(input): Flags that indicates behavior for file opening and access. This is an inclusive OR of the following values ( such of them are not compatible) :

  • FSAL_O_RDONLY: opening file for reading only.
  • FSAL_O_RDWR: opening file for reading and writing.
  • FSAL_O_WRONLY: opening file for writting only.
  • FSAL_O_APPEND: always write at the end of the file.
  • FSAL_O_TRUNC: truncate the file to 0 on opening.
file_descriptor(output): The file descriptor to be used for FSAL_read/write operations.
file_attributes(optionnal input/output): Post operation attributes. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains).
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (user doesn't have the permissions for opening the file)
  • ERR_FSAL_STALE (filehandle does not address an existing object)
  • ERR_FSAL_INVAL (filehandle does not address a regular file, or open flags are conflicting)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 256 of file fsal_glue.c.

fsal_status_t FSAL_opendir ( fsal_handle_t dir_handle,
fsal_op_context_t p_context,
fsal_dir_t dir_descriptor,
fsal_attrib_list_t dir_attributes 
)

FSAL_opendir : Opens a directory for reading its content.

Parameters:
dir_handle(input) the handle of the directory to be opened.
p_context(input) Permission context for the operation (user, export context...).
dir_descriptor(output) pointer to an allocated structure that will receive directory stream informations, on successfull completion.
dir_attributes(optional output) On successfull completion,the structure pointed by dir_attributes receives the new directory attributes. Can be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (user does not have read permission on directory)
  • ERR_FSAL_STALE (dir_handle does not address an existing object)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 228 of file fsal_glue.c.

fsal_status_t FSAL_rcp ( fsal_handle_t filehandle,
fsal_op_context_t p_context,
fsal_path_t p_local_path,
fsal_rcpflag_t  transfer_opt 
)

FSAL_rcp: Copy an HPSS file to/from a local filesystem.

Parameters:
filehandle(input): Handle of the HPSS file to be copied.
p_context(input): Authentication context for the operation (user,...).
p_local_path(input): Path of the file in the local filesystem.
transfer_opt(input): Flags that indicate transfer direction and options. This consists of an inclusive OR between the following values :

  • FSAL_RCP_FS_TO_LOCAL: Copy the file from the filesystem to a local path.
  • FSAL_RCP_LOCAL_TO_FS: Copy the file from local path to the filesystem.
  • FSAL_RCP_LOCAL_CREAT: Create the target local file if it doesn't exist.
  • FSAL_RCP_LOCAL_EXCL: Produce an error if the target local file already exists.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (user doesn't have the permissions for opening the file)
  • ERR_FSAL_STALE (filehandle does not address an existing object)
  • ERR_FSAL_INVAL (filehandle does not address a regular file, or tranfert options are conflicting)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ERR_FSAL_NOSPC, ERR_FSAL_DQUOT...

Definition at line 452 of file fsal_glue.c.

fsal_status_t FSAL_read ( fsal_file_t file_descriptor,
fsal_seek_t seek_descriptor,
fsal_size_t  buffer_size,
caddr_t  buffer,
fsal_size_t read_amount,
fsal_boolean_t end_of_file 
)

FSAL_read: Perform a read operation on an opened file.

Parameters:
file_descriptor(input): The file descriptor returned by FSAL_open.
seek_descriptor(optional input): Specifies the position where data is to be read. If not specified, data will be read at the current position.
buffer_size(input): Amount (in bytes) of data to be read.
buffer(output): Address where the read data is to be stored in memory.
read_amount(output): Pointer to the amount of data (in bytes) that have been read during this call.
end_of_file(output): Pointer to a boolean that indicates whether the end of file has been reached during this call.
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_INVAL (invalid parameter)
  • ERR_FSAL_NOT_OPENED (tried to read in a non-opened fsal_file_t)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 277 of file fsal_glue.c.

fsal_status_t FSAL_readdir ( fsal_dir_t dir_descriptor,
fsal_cookie_t  start_position,
fsal_attrib_mask_t  get_attr_mask,
fsal_mdsize_t  buffersize,
fsal_dirent_t pdirent,
fsal_cookie_t end_position,
fsal_count_t nb_entries,
fsal_boolean_t end_of_dir 
)

FSAL_readdir : Read the entries of an opened directory.

Parameters:
dir_descriptor(input): Pointer to the directory descriptor filled by FSAL_opendir.
start_position(input): Cookie that indicates the first object to be read during this readdir operation. This should be :

  • FSAL_READDIR_FROM_BEGINNING for reading the content of the directory from the beginning.
  • The end_position parameter returned by the previous call to FSAL_readdir.
get_attr_mask(input) Specify the set of attributes to be retrieved for directory entries.
buffersize(input) The size (in bytes) of the buffer where the direntries are to be stored.
pdirent(output) Adresse of the buffer where the direntries are to be stored.
end_position(output) Cookie that indicates the current position in the directory.
nb_entries(output) Pointer to the number of entries read during the call.
end_of_dir(output) Pointer to a boolean that indicates if the end of dir has been reached during the call.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ...

Definition at line 237 of file fsal_glue.c.

fsal_status_t FSAL_readlink ( fsal_handle_t linkhandle,
fsal_op_context_t p_context,
fsal_path_t p_link_content,
fsal_attrib_list_t link_attributes 
)

FSAL_readlink: Read the content of a symbolic link.

Parameters:
linkhandle(input): Handle of the link to be read.
cred(input): Authentication context for the operation (user,...).
p_link_content(output): Pointer to an fsal path structure where the link content is to be stored..
link_attributes(optionnal input/output): The post operation attributes of the symlink link. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (linkhandle does not address an existing object)
  • ERR_FSAL_INVAL (linkhandle does not address a symbolic link)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 479 of file fsal_glue.c.

fsal_status_t FSAL_RemoveXAttrById ( fsal_handle_t p_objecthandle,
fsal_op_context_t p_context,
unsigned int  xattr_id 
)

Removes a xattr by Id

Parameters:
p_objecthandleHandle of the object you want to get attribute for.
p_contextpointer to the current security context.
xattr_idxattr's id

Definition at line 685 of file fsal_glue.c.

fsal_status_t FSAL_RemoveXAttrByName ( fsal_handle_t p_objecthandle,
fsal_op_context_t p_context,
const fsal_name_t xattr_name 
)

Removes a xattr by Name

Parameters:
p_objecthandleHandle of the object you want to get attribute for.
p_contextpointer to the current security context.
xattr_namexattr's name

Definition at line 692 of file fsal_glue.c.

fsal_status_t FSAL_rename ( fsal_handle_t old_parentdir_handle,
fsal_name_t p_old_name,
fsal_handle_t new_parentdir_handle,
fsal_name_t p_new_name,
fsal_op_context_t p_context,
fsal_attrib_list_t src_dir_attributes,
fsal_attrib_list_t tgt_dir_attributes 
)

FSAL_rename: Change name and/or parent dir of a filesystem object.

Parameters:
old_parentdir_handle(input): Source parent directory of the object is to be moved/renamed.
p_old_name(input): Pointer to the current name of the object to be moved/renamed.
new_parentdir_handle(input): Target parent directory for the object.
p_new_name(input): Pointer to the new name for the object.
p_context(input): Authentication context for the operation (user,...).
src_dir_attributes(optionnal input/output): Post operation attributes for the source directory. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
tgt_dir_attributes(optionnal input/output): Post operation attributes for the target directory. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (a parent directory handle does not address an existing object)
  • ERR_FSAL_NOTDIR (a parent directory handle does not address a directory)
  • ERR_FSAL_NOENT (the object designated by p_old_name does not exist)
  • ERR_FSAL_NOTEMPTY (the target object is a non empty directory)
  • ERR_FSAL_XDEV (tried to move an object across different filesystems)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 460 of file fsal_glue.c.

fsal_status_t FSAL_rename_access ( fsal_op_context_t pcontext,
fsal_attrib_list_t pattrsrc,
fsal_attrib_list_t pattrdest 
)

FSAL_rename_access : test if a client identified by cred can be renamed on the object knowing the parents attributes

Parameters:
pcontext(in fsal_cred_t *) user's context.
pattrsrcsource directory attributes
pattrdestdestination directory attributes
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (Permission denied)
  • ERR_FSAL_FAULT (null pointer parameter)
  • ERR_FSAL_INVAL (missing attributes : mode, group, user,...)
  • ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 361 of file fsal_glue.c.

fsal_status_t FSAL_set_quota ( fsal_path_t pfsal_path,
int  quota_type,
fsal_uid_t  fsal_uid,
fsal_quota_t pquot,
fsal_quota_t presquot 
)

FSAL_get_quota : Gets the quota for a given path.

Parameters:
pfsal_pathpath to the filesystem whose quota are requested
fsal_uiduid for the user whose quota are requested
pquota(input): pointer to the structure containing the wanted quotas
presquot(output) pointer to the structure containing the resulting quotas
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • Another error code if an error occured.

Definition at line 427 of file fsal_glue.c.

fsal_status_t FSAL_setattr_access ( fsal_op_context_t p_context,
fsal_attrib_list_t candidate_attributes,
fsal_attrib_list_t object_attributes 
)

FSAL_test_setattr_access : test if a client identified by cred can access setattr on the object knowing its attributes and parent's attributes. The following fields of the object_attributes structures MUST be filled : acls (if supported), mode, owner, group. This doesn't make any call to the filesystem, as a result, this doesn't ensure that the file exists, nor that the permissions given as parameters are the actual file permissions : this must be ensured by the cache_inode layer, using FSAL_getattrs, for example.

Parameters:
cred(in fsal_cred_t *) user's identifier.
candidate_attrbutesthe attributes we want to set on the object
object_attributes(in fsal_attrib_list_t *) the cached attributes for the object.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (Permission denied)
  • ERR_FSAL_FAULT (null pointer parameter)
  • ERR_FSAL_INVAL (missing attributes : mode, group, user,...)
  • ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 353 of file fsal_glue.c.

fsal_status_t FSAL_setattrs ( fsal_handle_t filehandle,
fsal_op_context_t p_context,
fsal_attrib_list_t attrib_set,
fsal_attrib_list_t object_attributes 
)

FSAL_setattrs: Set attributes for the object specified by its filehandle.

Parameters:
filehandle(input): The handle of the object to get parameters.
p_context(input): Authentication context for the operation (user,...).
attrib_set(mandatory input): The attributes to be set for the object. It defines the attributes that the caller wants to set and their values.
object_attributes(optionnal input/output): The post operation attributes for the object. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (object_handle does not address an existing object)
  • ERR_FSAL_INVAL (tried to modify a read-only attribute)
  • ERR_FSAL_ATTRNOTSUPP (tried to modify a non-supported attribute)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Another error code if an error occured. NB: if getting postop attributes failed, the function does not return an error but the FSAL_ATTR_RDATTR_ERR bit is set in the object_attributes->asked_attributes field.

Definition at line 73 of file fsal_glue.c.

fsal_status_t FSAL_SetDefault_FS_common_parameter ( fsal_parameter_t out_parameter)

Definition at line 558 of file fsal_glue.c.

fsal_status_t FSAL_SetDefault_FS_specific_parameter ( fsal_parameter_t out_parameter)

Definition at line 563 of file fsal_glue.c.

fsal_status_t FSAL_SetDefault_FSAL_parameter ( fsal_parameter_t out_parameter)

Those routines set the default parameters for FSAL init structure.

Returns:
ERR_FSAL_NO_ERROR (no error) , ERR_FSAL_FAULT (null pointer given as parameter), ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 553 of file fsal_glue.c.

fsal_status_t FSAL_SetXAttrValue ( fsal_handle_t p_objecthandle,
const fsal_name_t xattr_name,
fsal_op_context_t p_context,
caddr_t  buffer_addr,
size_t  buffer_size,
int  create 
)

Set the value of an extended attribute.

Parameters:
p_objecthandleHandle of the object you want to set attribute for.
xattr_namethe name of the attribute to be written.
p_contextpointer to the current security context.
buffer_addraddress of the buffer where the xattr value is stored.
buffer_sizesize of the buffer where the xattr value is stored.
createthis boolean specifies if the attribute is created if it does not exist.

Definition at line 664 of file fsal_glue.c.

fsal_status_t FSAL_SetXAttrValueById ( fsal_handle_t p_objecthandle,
unsigned int  xattr_id,
fsal_op_context_t p_context,
caddr_t  buffer_addr,
size_t  buffer_size 
)

Set the value of an extended attribute by its Id.

Parameters:
p_objecthandleHandle of the object you want to set attribute for.
xattr_idindex of the attribute to be written.
p_contextpointer to the current security context.
buffer_addraddress of the buffer where the xattr value is stored.
buffer_sizesize of the buffer where the xattr value is stored.

Definition at line 675 of file fsal_glue.c.

fsal_status_t FSAL_share_op ( fsal_file_t p_file_descriptor,
fsal_handle_t p_filehandle,
fsal_op_context_t p_context,
void *  p_owner,
fsal_share_param_t  request_share 
)

Definition at line 731 of file fsal_glue.c.

fsal_status_t FSAL_symlink ( fsal_handle_t parent_directory_handle,
fsal_name_t p_linkname,
fsal_path_t p_linkcontent,
fsal_op_context_t p_context,
fsal_accessmode_t  accessmode,
fsal_handle_t link_handle,
fsal_attrib_list_t link_attributes 
)

FSAL_symlink: Create a symbolic link.

Parameters:
parent_directory_handle(input): Handle of the parent directory where the link is to be created.
p_linkname(input): Name of the link to be created.
p_linkcontent(input): Content of the link to be created.
cred(input): Authentication context for the operation (user,...).
accessmode(ignored input): Mode of the link to be created. It has no sense in HPSS nor UNIX filesystems.
link_handle(output): Pointer to the handle of the created symlink.
link_attributes(optionnal input/output): Attributes of the newly created symlink. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (parent_directory_handle does not address an existing object)
  • ERR_FSAL_NOTDIR (parent_directory_handle does not address a directory)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 488 of file fsal_glue.c.

fsal_status_t FSAL_terminate ( )

Definition at line 341 of file fsal_glue.c.

fsal_status_t FSAL_test_access ( fsal_op_context_t p_context,
fsal_accessflags_t  access_type,
fsal_attrib_list_t object_attributes 
)

FSAL_test_access : test if a client identified by cred can access the object whom the attributes are object_attributes. The following fields of the object_attributes structure MUST be filled : acls (if supported), mode, owner, group. This doesn't make any call to the filesystem, as a result, this doesn't ensure that the file exists, nor that the permissions given as parameters are the actual file permissions : this must be ensured by the cache_inode layer, using FSAL_getattrs, for example.

FSAL_test_access : Tests whether the user identified by the p_context structure can access the object as indicated by the access_type parameter. This function tests access rights using cached attributes given as parameter (no calls to filesystem). Thus, it cannot test FSAL_F_OK flag, and asking such a flag will result in a ERR_FSAL_INVAL error.

Parameters:
p_context(input): Authentication context for the operation (user,...).
access_type(input): Indicates the permissions to test. This is an inclusive OR of the permissions to be checked for the user identified by cred. Permissions constants are :

  • FSAL_R_OK : test for read permission
  • FSAL_W_OK : test for write permission
  • FSAL_X_OK : test for exec permission
  • FSAL_F_OK : test for file existence
object_attributes(mandatory input): The cached attributes for the object to test rights on. The following attributes MUST be filled : owner, group, mode, ACLs.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error, permission granted)
  • ERR_FSAL_ACCESS (object permissions doesn't fit asked access type)
  • ERR_FSAL_INVAL (FSAL_test_access is not able to test such a permission)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Another error code if an error occured.

Todo:
: ACLs.

Definition at line 346 of file fsal_glue.c.

fsal_status_t FSAL_truncate ( fsal_handle_t filehandle,
fsal_op_context_t p_context,
fsal_size_t  length,
fsal_file_t file_descriptor,
fsal_attrib_list_t object_attributes 
)

FSAL_truncate: Modify the data length of a regular file.

Parameters:
filehandle(input): Handle of the file is to be truncated.
cred(input): Authentication context for the operation (user,...).
length(input): The new data length for the file.
object_attributes(optionnal input/output): The post operation attributes of the file. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (filehandle does not address an existing object)
  • ERR_FSAL_INVAL (filehandle does not address a regular file)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 587 of file fsal_glue.c.

fsal_status_t FSAL_uint64_to_cookie ( fsal_handle_t handle,
fsal_op_context_t context,
uint64_t uint64,
fsal_cookie_t cookie 
)

FSAL_uint64_to_cookie

This function converts a uint64_t value supplied by the NFS caller to the FSAL's cookie type.

Parameters:
[in]handleThe handle of the directory to which the cookie pertains
[in]contextThe FSAL operation context
[in]uint64The uint64_t value corresponding to the cookie
[out]cookieThe directory entry cookie

Definition at line 114 of file fsal_glue.c.

fsal_status_t FSAL_unlink ( fsal_handle_t parentdir_handle,
fsal_name_t p_object_name,
fsal_op_context_t p_context,
fsal_attrib_list_t parentdir_attributes 
)

FSAL_unlink: Remove a filesystem object .

Parameters:
parentdir_handle(input): Handle of the parent directory of the object to be deleted.
p_object_name(input): Name of the object to be removed.
p_context(input): Authentication context for the operation (user,...).
parentdir_attributes(optionnal input/output): Post operation attributes of the parent directory. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). May be NULL.
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_STALE (parentdir_handle does not address an existing object)
  • ERR_FSAL_NOTDIR (parentdir_handle does not address a directory)
  • ERR_FSAL_NOENT (the object designated by p_object_name does not exist)
  • ERR_FSAL_NOTEMPTY (tried to remove a non empty directory)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_ACCESS, ERR_FSAL_IO, ...

Definition at line 597 of file fsal_glue.c.

fsal_status_t FSAL_unlink_access ( fsal_op_context_t pcontext,
fsal_attrib_list_t pattr 
)

FSAL_unlink_access : test if a client identified by cred can unlink on a directory knowing its attributes

Parameters:
pcontext(in fsal_cred_t *) user's context.
pattrsource directory attributes
Returns:
Major error codes :
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_ACCESS (Permission denied)
  • ERR_FSAL_FAULT (null pointer parameter)
  • ERR_FSAL_INVAL (missing attributes : mode, group, user,...)
  • ERR_FSAL_SERVERFAULT (unexpected error)

Definition at line 374 of file fsal_glue.c.

fsal_status_t FSAL_write ( fsal_file_t file_descriptor,
fsal_op_context_t p_context,
fsal_seek_t seek_descriptor,
fsal_size_t  buffer_size,
caddr_t  buffer,
fsal_size_t write_amount 
)

FSAL_write: Perform a write operation on an opened file.

Parameters:
file_descriptor(input): The file descriptor returned by FSAL_open.
p_context(input): Authentication context for the operation (user,...).
seek_descriptor(optional input): Specifies the position where data is to be written. If not specified, data will be written at the current position.
buffer_size(input): Amount (in bytes) of data to be written.
buffer(input): Address in memory of the data to write to file.
write_amount(output): Pointer to the amount of data (in bytes) that have been written during this call.
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error)
  • ERR_FSAL_INVAL (invalid parameter)
  • ERR_FSAL_NOT_OPENED (tried to write in a non-opened fsal_file_t)
  • ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
  • Other error codes can be returned : ERR_FSAL_IO, ERR_FSAL_NOSPC, ERR_FSAL_DQUOT...

Definition at line 288 of file fsal_glue.c.

fsal_dev_t posix2fsal_devt ( dev_t  posix_devid)

Definition at line 211 of file fsal_convert.c.

fsal_accessmode_t unix2fsal_mode ( mode_t  unix_mode)

unix2fsal_mode: Convert posix mode to FSAL mode.

Parameters:
unix_mode(input): The posix mode to be translated.
Returns:
The FSAL mode associated to unix_mode.

Definition at line 108 of file fsal_convert.c.