nfs-ganesha 1.4
Classes | Defines | Typedefs | Functions | Variables

fsal_internal.h File Reference

#include "fsal.h"
#include "FSAL/common_functions.h"
#include "nfs4.h"

Go to the source code of this file.

Classes

struct  fsal_proxy_internal_fattr__
struct  fsal_proxy_internal_fattr_readdir__

Defines

#define FSAL_PROXY_OWNER_LEN   256

Typedefs

typedef struct
fsal_proxy_internal_fattr__ 
fsal_proxy_internal_fattr_t
typedef struct
fsal_proxy_internal_fattr_readdir__ 
fsal_proxy_internal_fattr_readdir_t

Functions

void fsal_internal_proxy_setup_fattr (fsal_proxy_internal_fattr_t *pfattr)
void fsal_internal_proxy_setup_readdir_fattr (fsal_proxy_internal_fattr_readdir_t *pfattr)
fsal_status_t fsal_internal_init_global (fsal_init_info_t *fsal_info, fs_common_initinfo_t *fs_common_info)
void fsal_increment_nbcall (int function_index, fsal_status_t status)
void fsal_internal_getstats (fsal_statistics_t *output_stats)
void TakeTokenFSCall ()
void ReleaseTokenFSCall ()
fsal_boolean_t fsal_do_log (fsal_status_t status)
void fsal_internal_proxy_create_fattr_bitmap (bitmap4 *pbitmap)
void fsal_internal_proxy_create_fattr_readdir_bitmap (bitmap4 *pbitmap)
void fsal_internal_proxy_create_fattr_fsinfo_bitmap (bitmap4 *pbitmap)
void fsal_interval_proxy_fsalattr2bitmap4 (fsal_attrib_list_t *pfsalattr, bitmap4 *pbitmap)
fsal_status_t fsal_internal_set_auth_gss (proxyfsal_op_context_t *p_thr_context)
fsal_status_t fsal_internal_proxy_error_convert (nfsstat4 nfsstatus, int indexfunc)
int fsal_internal_proxy_create_fh (nfs_fh4 *pnfs4_handle, fsal_nodetype_t type, fsal_u64_t fileid, fsal_handle_t *pfsal_handle)
int fsal_internal_proxy_extract_fh (nfs_fh4 *pnfs4_handle, fsal_handle_t *pfsal_handle)
int fsal_internal_proxy_fsal_name_2_utf8 (fsal_name_t *pname, utf8string *utf8str)
int fsal_internal_proxy_fsal_path_2_utf8 (fsal_path_t *ppath, utf8string *utf8str)
int fsal_internal_proxy_fsal_utf8_2_name (fsal_name_t *pname, utf8string *utf8str)
int fsal_internal_proxy_fsal_utf8_2_path (fsal_path_t *ppath, utf8string *utf8str)
int proxy_Fattr_To_FSAL_attr (fsal_attrib_list_t *pFSAL_attr, proxyfsal_handle_t *phandle, fattr4 *Fattr)
int proxy_Fattr_To_FSAL_dynamic_fsinfo (fsal_dynamicfsinfo_t *pdynamicinfo, fattr4 *Fattr)
fsal_status_t FSAL_proxy_setclientid (proxyfsal_op_context_t *p_context)
fsal_status_t FSAL_proxy_setclientid_renego (proxyfsal_op_context_t *p_context)
fsal_status_t fsal_proxy_create_rpc_clnt (proxyfsal_op_context_t *)
int fsal_internal_ClientReconnect (proxyfsal_op_context_t *p_thr_context)
fsal_status_t FSAL_proxy_open_confirm (proxyfsal_file_t *pfd)
void * FSAL_proxy_change_user (proxyfsal_op_context_t *p_thr_context)
fsal_status_t PROXYFSAL_access (fsal_handle_t *p_object_handle, fsal_op_context_t *p_context, fsal_accessflags_t access_type, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_getattrs (fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_setattrs (fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, fsal_attrib_list_t *p_attrib_set, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_BuildExportContext (fsal_export_context_t *p_export_context, fsal_path_t *p_export_path, char *fs_specific_options)
fsal_status_t PROXYFSAL_InitClientContext (fsal_op_context_t *p_thr_context)
fsal_status_t PROXYFSAL_create (fsal_handle_t *p_parent_directory_handle, fsal_name_t *p_filename, fsal_op_context_t *p_context, fsal_accessmode_t accessmode, fsal_handle_t *p_object_handle, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_mkdir (fsal_handle_t *p_parent_directory_handle, fsal_name_t *p_dirname, fsal_op_context_t *p_context, fsal_accessmode_t accessmode, fsal_handle_t *p_object_handle, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_link (fsal_handle_t *p_target_handle, fsal_handle_t *p_dir_handle, fsal_name_t *p_link_name, fsal_op_context_t *p_context, fsal_attrib_list_t *p_attributes)
fsal_status_t PROXYFSAL_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 PROXYFSAL_opendir (fsal_handle_t *p_dir_handle, fsal_op_context_t *p_context, fsal_dir_t *p_dir_descriptor, fsal_attrib_list_t *p_dir_attributes)
fsal_status_t PROXYFSAL_readdir (fsal_dir_t *p_dir_descriptor, fsal_cookie_t start_position, fsal_attrib_mask_t get_attr_mask, fsal_mdsize_t buffersize, fsal_dirent_t *p_pdirent, fsal_cookie_t *p_end_position, fsal_count_t *p_nb_entries, fsal_boolean_t *p_end_of_dir)
fsal_status_t PROXYFSAL_closedir (fsal_dir_t *p_dir_descriptor)
fsal_status_t PROXYFSAL_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 PROXYFSAL_open (fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, fsal_openflags_t openflags, fsal_file_t *p_file_descriptor, fsal_attrib_list_t *p_file_attributes)
fsal_status_t PROXYFSAL_read (fsal_file_t *p_file_descriptor, fsal_seek_t *p_seek_descriptor, fsal_size_t buffer_size, caddr_t buffer, fsal_size_t *p_read_amount, fsal_boolean_t *p_end_of_file)
fsal_status_t PROXYFSAL_write (fsal_file_t *p_file_descriptor, fsal_op_context_t *p_context, fsal_seek_t *p_seek_descriptor, fsal_size_t buffer_size, caddr_t buffer, fsal_size_t *p_write_amount)
fsal_status_t PROXYFSAL_commit (fsal_file_t *p_file_descriptor, fsal_off_t offset, fsal_size_t size)
fsal_status_t PROXYFSAL_close (fsal_file_t *p_file_descriptor)
fsal_status_t PROXYFSAL_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 PROXYFSAL_close_by_fileid (fsal_file_t *file_descriptor, fsal_u64_t fileid)
fsal_status_t PROXYFSAL_dynamic_fsinfo (fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, fsal_dynamicfsinfo_t *p_dynamicinfo)
fsal_status_t PROXYFSAL_Init (fsal_parameter_t *init_info)
fsal_status_t PROXYFSAL_terminate ()
fsal_status_t PROXYFSAL_test_access (fsal_op_context_t *p_context, fsal_accessflags_t access_type, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_setattr_access (fsal_op_context_t *p_context, fsal_attrib_list_t *candidate_attributes, fsal_attrib_list_t *object_attributes)
fsal_status_t PROXYFSAL_lookup (fsal_handle_t *p_parent_directory_handle, fsal_name_t *p_filename, fsal_op_context_t *p_context, fsal_handle_t *p_object_handle, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_lookupPath (fsal_path_t *p_path, fsal_op_context_t *p_context, fsal_handle_t *object_handle, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_rename (fsal_handle_t *p_old_parentdir_handle, fsal_name_t *p_old_name, fsal_handle_t *p_new_parentdir_handle, fsal_name_t *p_new_name, fsal_op_context_t *p_context, fsal_attrib_list_t *p_src_dir_attributes, fsal_attrib_list_t *p_tgt_dir_attributes)
void PROXYFSAL_get_stats (fsal_statistics_t *stats, fsal_boolean_t reset)
fsal_status_t PROXYFSAL_readlink (fsal_handle_t *p_linkhandle, fsal_op_context_t *p_context, fsal_path_t *p_link_content, fsal_attrib_list_t *p_link_attributes)
fsal_status_t PROXYFSAL_symlink (fsal_handle_t *p_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 *p_link_handle, fsal_attrib_list_t *p_link_attributes)
int PROXYFSAL_handlecmp (fsal_handle_t *handle1, fsal_handle_t *handle2, fsal_status_t *status)
unsigned int PROXYFSAL_Handle_to_HashIndex (fsal_handle_t *p_handle, unsigned int cookie, unsigned int alphabet_len, unsigned int index_size)
unsigned int PROXYFSAL_Handle_to_RBTIndex (fsal_handle_t *p_handle, unsigned int cookie)
fsal_status_t PROXYFSAL_DigestHandle (fsal_export_context_t *p_expcontext, fsal_digesttype_t output_type, fsal_handle_t *p_in_fsal_handle, struct fsal_handle_desc *fh_desc)
fsal_status_t PROXYFSAL_ExpandHandle (fsal_export_context_t *p_expcontext, fsal_digesttype_t in_type, struct fsal_handle_desc *in_buff)
fsal_status_t PROXYFSAL_SetDefault_FS_specific_parameter (fsal_parameter_t *out_parameter)
fsal_status_t PROXYFSAL_load_FS_specific_parameter_from_conf (config_file_t in_config, fsal_parameter_t *out_parameter)
fsal_status_t PROXYFSAL_truncate (fsal_handle_t *p_filehandle, fsal_op_context_t *p_context, fsal_size_t length, fsal_file_t *file_descriptor, fsal_attrib_list_t *p_object_attributes)
fsal_status_t PROXYFSAL_unlink (fsal_handle_t *p_parent_directory_handle, fsal_name_t *p_object_name, fsal_op_context_t *p_context, fsal_attrib_list_t *p_parent_directory_attributes)
char * PROXYFSAL_GetFSName ()
fsal_status_t PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_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 PROXYFSAL_RemoveXAttrById (fsal_handle_t *p_objecthandle, fsal_op_context_t *p_context, unsigned int xattr_id)
fsal_status_t PROXYFSAL_RemoveXAttrByName (fsal_handle_t *p_objecthandle, fsal_op_context_t *p_context, const fsal_name_t *xattr_name)
int PROXYFSAL_GetXattrOffsetSetable (void)
unsigned int PROXYFSAL_GetFileno (fsal_file_t *pfile)

Variables

fsal_staticfsinfo_t global_fs_info

Define Documentation

#define FSAL_PROXY_OWNER_LEN   256

Definition at line 21 of file FSAL_PROXY/fsal_internal.h.


Typedef Documentation


Function Documentation

fsal_boolean_t fsal_do_log ( fsal_status_t  status)

fsal_do_log: Indicates if an FSAL error has to be traced into its log file in the NIV_EVENT level. (in the other cases, return codes are only logged in the NIV_FULL_DEBUG logging lovel).

fsal_do_log: Indicates if an FSAL error has to be traced into its log file in the NIV_EVENT level. (in the other cases, return codes are only logged in the NIV_FULL_DEBUG logging lovel).

Parameters:
status(input),:The fsal status that is to be tested.
Returns:
- TRUE if the error is to be traced.
  • FALSE if the error must not be traced except in NIV_FULL_DEBUG level.

Definition at line 345 of file FSAL_FUSELIKE/fsal_internal.c.

void fsal_increment_nbcall ( int  function_index,
fsal_status_t  status 
)

Increments the number of calls for a function.

fsal_increment_nbcall: Updates fonction call statistics.

Parameters:
function_index(input): Index of the function whom number of call is to be incremented.
status(input): Status the function returned.
Returns:
Nothing.

Definition at line 135 of file FSAL_CEPH/fsal_internal.c.

int fsal_internal_ClientReconnect ( proxyfsal_op_context_t p_thr_context)

fsal_internal_ClientReconnect: Redo a previously lost connection to the server.

Redo a previously lost connection to the server.

Parameters:
p_thr_context[INOUT] pointer to the FSAL thread context.
Returns:
0 if successful, -1 if failed

Definition at line 922 of file fsal_proxy_internal.c.

void fsal_internal_getstats ( fsal_statistics_t output_stats)

Retrieves current thread statistics.

fsal_internal_getstats: (For internal use in the FSAL). Retrieve call statistics for current thread.

Parameters:
output_stats(output): Pointer to the call statistics structure.
Returns:
Nothing.

Definition at line 211 of file FSAL_CEPH/fsal_internal.c.

fsal_status_t fsal_internal_init_global ( fsal_init_info_t fsal_info,
fs_common_initinfo_t fs_common_info 
)

This function initializes shared variables of the FSAL.

Definition at line 262 of file FSAL_FUSELIKE/fsal_internal.c.

void fsal_internal_proxy_create_fattr_bitmap ( bitmap4 pbitmap)

fsal_internal_proxy_create_fattr_bitmap : Create the fattr4 bitmap related to the attributes managed by this implementation of the proxy

Parameters:
none
Returns:
the desired bitmap

Definition at line 87 of file fsal_proxy_internal.c.

void fsal_internal_proxy_create_fattr_fsinfo_bitmap ( bitmap4 pbitmap)

Definition at line 147 of file fsal_proxy_internal.c.

void fsal_internal_proxy_create_fattr_readdir_bitmap ( bitmap4 pbitmap)

Definition at line 117 of file fsal_proxy_internal.c.

int fsal_internal_proxy_create_fh ( nfs_fh4 pnfs4_handle,
fsal_nodetype_t  type,
fsal_u64_t  fileid,
fsal_handle_t fsal_handle 
)

fsal_internal_proxy_create_fh :

Parameters:
pnfs4_handle[IN] the NFSv4 Handle
type[IN] the type of object for this entry
fileid[IN] the file id for this entry
pfsal_handle[OUT] the resulting FSAL Handle
Returns:
TRUE if OK, FALSE otherwise

Definition at line 389 of file fsal_proxy_internal.c.

fsal_status_t fsal_internal_proxy_error_convert ( nfsstat4  nfsstatus,
int  indexfunc 
)

fsal_internal_proxy_error_convert : Build a fsal_status in a correct way based on a NFS status

Parameters:
nfsstatus[IN] the nfs status to be converted
indexfunc[IN] the index of the FSAL function was does the call
Returns:
the converted value

Definition at line 194 of file fsal_proxy_internal.c.

int fsal_internal_proxy_extract_fh ( nfs_fh4 pnfs4_handle,
fsal_handle_t fsal_handle 
)

fsal_internal_proxy_extract_fh : Do the FSAL -> NFSv4 FH conversion

Parameters:
pnfs4_handle[OUT] the NFSv4 Handle
pfsal_handle[IN] the resulting FSAL Handle
Returns:
TRUE if OK, FALSE otherwise

Definition at line 449 of file fsal_proxy_internal.c.

int fsal_internal_proxy_fsal_name_2_utf8 ( fsal_name_t pname,
utf8string utf8str 
)

fsal_internal_proxy_fsal_name_2_utf8 : Do the FSAL -> NFSv4 UTF8 str conversion

Parameters:
pname[IN] the fsal name
utf8str[OUT] the resulting UTF8 str
Returns:
TRUE if OK, FALSE otherwise

Definition at line 482 of file fsal_proxy_internal.c.

int fsal_internal_proxy_fsal_path_2_utf8 ( fsal_path_t ppath,
utf8string utf8str 
)

fsal_internal_proxy_fsal_path_2_utf8 : Do the FSAL -> NFSv4 UTF8 str conversion

Parameters:
ppath[IN] the fsal path
utf8str[OUT] the resulting UTF8 str
Returns:
TRUE if OK, FALSE otherwise

Definition at line 519 of file fsal_proxy_internal.c.

int fsal_internal_proxy_fsal_utf8_2_name ( fsal_name_t pname,
utf8string utf8str 
)

fsal_internal_proxy_fsal_utf8_2_name : Do the NFSv4 UTF8 -> FSAL str conversion

Parameters:
pname[IN] the fsal name
utf8str[OUT] the resulting UTF8 str
Returns:
TRUE if OK, FALSE otherwise

Definition at line 587 of file fsal_proxy_internal.c.

int fsal_internal_proxy_fsal_utf8_2_path ( fsal_path_t ppath,
utf8string utf8str 
)

fsal_internal_proxy_fsal_utf8_2_path : Do the NFSv4 UTF8 -> FSAL str conversion

Parameters:
ppath[IN] the fsal path
utf8str[OUT] the resulting UTF8 str
Returns:
TRUE if OK, FALSE otherwise

Definition at line 557 of file fsal_proxy_internal.c.

void fsal_internal_proxy_setup_fattr ( fsal_proxy_internal_fattr_t pfattr)

Definition at line 176 of file fsal_proxy_internal.c.

void fsal_internal_proxy_setup_readdir_fattr ( fsal_proxy_internal_fattr_readdir_t pfattr)

Definition at line 168 of file fsal_proxy_internal.c.

fsal_status_t fsal_internal_set_auth_gss ( proxyfsal_op_context_t p_thr_context)

Definition at line 758 of file fsal_proxy_internal.c.

void fsal_interval_proxy_fsalattr2bitmap4 ( fsal_attrib_list_t pfsalattr,
bitmap4 pbitmap 
)

Definition at line 53 of file fsal_proxy_internal.c.

void* FSAL_proxy_change_user ( proxyfsal_op_context_t p_thr_context)

Todo:
: Nothing done now. Once RPCSEC_GSS will have explicit management, return an error as defaut behavior: non supported auth flavor

Definition at line 1065 of file fsal_proxy_internal.c.

fsal_status_t fsal_proxy_create_rpc_clnt ( proxyfsal_op_context_t )

Definition at line 794 of file fsal_proxy_internal.c.

fsal_status_t FSAL_proxy_open_confirm ( proxyfsal_file_t pfd)

FSAL_proxy_open_confirm: Confirms a previously made OP_OPEN if this is required by the server

Parameters:
pfd[INOUT] : Open file descriptor for the file whose open is to be confirmed
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR (no error) ERR_FSAL_IO, ...

Definition at line 966 of file fsal_proxy_internal.c.

fsal_status_t FSAL_proxy_setclientid ( proxyfsal_op_context_t p_context)

FSAL_proxy_setclientid: Client ID negociation, step 1

Parameters:
p_context(input): Authentication context for the operation (user,...).
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_ACCESS, ERR_FSAL_IO, ...

Definition at line 238 of file fsal_proxy_clientid.c.

fsal_status_t FSAL_proxy_setclientid_renego ( proxyfsal_op_context_t p_context)

FSAL_proxy_setclientid_renego:

Parameters:
p_context(input): Authentication context for the operation (user,...).
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_ACCESS, ERR_FSAL_IO, ...

Definition at line 209 of file fsal_proxy_clientid.c.

int proxy_Fattr_To_FSAL_attr ( fsal_attrib_list_t pFSAL_attr,
proxyfsal_handle_t phandle,
fattr4 Fattr 
)

proxy_Fattr_To_FSAL_attr: Converts NFSv4 attributes buffer to a FSAL attributes structure.

Converts NFSv4 attributes buffer to a FSAL attributes structure.

Parameters:
pFSAL_attr[OUT] pointer to FSAL attributes.
Fattr[IN] pointer to NFSv4 attributes.
Returns:
1 if successful, 0 if not supported, -1 if argument is badly formed

Definition at line 746 of file fsal_proxy_internal.c.

int proxy_Fattr_To_FSAL_dynamic_fsinfo ( fsal_dynamicfsinfo_t pdynamicinfo,
fattr4 Fattr 
)

proxy_Fattr_To_FSAL_dynamic_fsinfo: Converts NFSv4 attributes buffer to a FSAL dynamic fsinfo structure.

Converts NFSv4 attributes buffer to a FSAL dynamic fsinfo structure.

Parameters:
pdynamicinfo[OUT] pointer to FSAL attributes.
Fattr[IN] pointer to NFSv4 attributes.
Returns:
1 if successful, 0 if not supported, -1 if argument is badly formed

Definition at line 617 of file fsal_proxy_internal.c.

fsal_status_t PROXYFSAL_access ( fsal_handle_t object_handle,
fsal_op_context_t context,
fsal_accessflags_t  access_type,
fsal_attrib_list_t object_attributes 
)

PROXYFSAL_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 74 of file FSAL_PROXY/fsal_access.c.

fsal_status_t PROXYFSAL_close ( fsal_file_t file_desc)

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 702 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_close_by_fileid ( fsal_file_t file_desc,
fsal_u64_t  fileid 
)

FSAL_close_by_fileid: Free the resources allocated by the FSAL_open_by_fileid 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 781 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_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 315 of file FSAL_PROXY/fsal_dirs.c.

fsal_status_t PROXYFSAL_commit ( fsal_file_t p_file_descriptor,
fsal_off_t  offset,
fsal_size_t  length 
)

FSAL_commit: This function is used for processing stable writes and COMMIT requests. Calling this function makes sure the changes to a specific file are written to disk rather than kept in memory.

Parameters:
file_descriptor(input): The file descriptor returned by FSAL_open.
offset,:The starting offset for the portion of file to be synced
length,:The length for the portion of file to be synced.
Returns:
Major error codes:
  • ERR_FSAL_NO_ERROR: no error.
  • Another error code if an error occured during this call.

Definition at line 1137 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_create ( fsal_handle_t parent_directory_handle,
fsal_name_t p_filename,
fsal_op_context_t 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 80 of file FSAL_PROXY/fsal_create.c.

fsal_status_t PROXYFSAL_DigestHandle ( fsal_export_context_t exp_context,
fsal_digesttype_t  output_type,
fsal_handle_t in_handle,
struct fsal_handle_desc fh_desc 
)

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

Parameters:
output_type(input): Indicates the type of digest to do.
in_fsal_handle(input): The handle to be converted to digest.
out_buff(output): The buffer where the digest is to be stored.
Returns:
The major code is ERR_FSAL_NO_ERROR is no error occured. Else, it is a non null value.

Definition at line 217 of file FSAL_PROXY/fsal_tools.c.

fsal_status_t PROXYFSAL_dynamic_fsinfo ( fsal_handle_t filehandle,
fsal_op_context_t 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 58 of file FSAL_PROXY/fsal_fsinfo.c.

fsal_status_t PROXYFSAL_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.

Parameters:
in_type(input): Indicates the type of digest to be expanded.
fh_desc(input/output): Pointer to the handle descriptor, length is set and verified
Returns:
The major code is ERR_FSAL_NO_ERROR is no error occured. Else, it is a non null value.

Definition at line 310 of file FSAL_PROXY/fsal_tools.c.

void PROXYFSAL_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 37 of file FSAL_PROXY/fsal_stats.c.

fsal_status_t PROXYFSAL_getattrs ( fsal_handle_t filehandle,
fsal_op_context_t context,
fsal_attrib_list_t object_attributes 
)

PROXYFSAL_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.

Todo:
BUGAZOMEU Cleaner supported_attributes to be put here

Definition at line 63 of file FSAL_PROXY/fsal_attrs.c.

unsigned int PROXYFSAL_GetFileno ( fsal_file_t pfile)

Definition at line 1111 of file FSAL_PROXY/fsal_fileop.c.

char* PROXYFSAL_GetFSName ( )

Definition at line 44 of file FSAL_PROXY/fsal_tools.c.

fsal_status_t PROXYFSAL_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 414 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_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 600 of file FSAL_PROXY/fsal_xattrs.c.

int PROXYFSAL_GetXattrOffsetSetable ( void  )

Definition at line 724 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_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 550 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_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 642 of file FSAL_PROXY/fsal_xattrs.c.

unsigned int PROXYFSAL_Handle_to_HashIndex ( fsal_handle_t 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 104 of file FSAL_PROXY/fsal_tools.c.

unsigned int PROXYFSAL_Handle_to_RBTIndex ( fsal_handle_t p_handle,
unsigned int  cookie 
)

Definition at line 155 of file FSAL_PROXY/fsal_tools.c.

int PROXYFSAL_handlecmp ( fsal_handle_t handle_1,
fsal_handle_t handle_2,
fsal_status_t status 
)

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 65 of file FSAL_PROXY/fsal_tools.c.

fsal_status_t PROXYFSAL_Init ( fsal_parameter_t init_info)

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 128 of file FSAL_PROXY/fsal_init.c.

fsal_status_t PROXYFSAL_link ( fsal_handle_t target_handle,
fsal_handle_t dir_handle,
fsal_name_t p_link_name,
fsal_op_context_t 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 536 of file FSAL_PROXY/fsal_create.c.

fsal_status_t PROXYFSAL_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 471 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_load_FS_specific_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),

#ifdef _ALLOW_NFS_PROTO_CHOICE

#endif

Definition at line 462 of file FSAL_PROXY/fsal_tools.c.

fsal_status_t PROXYFSAL_lookup ( fsal_handle_t p_parent_directory_handle,
fsal_name_t p_filename,
fsal_op_context_t p_context,
fsal_handle_t p_object_handle,
fsal_attrib_list_t p_object_attributes 
)

Definition at line 75 of file FSAL_PROXY/fsal_lookup.c.

fsal_status_t PROXYFSAL_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 
)

PROXYFSAL_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 394 of file FSAL_PROXY/fsal_lookup.c.

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

PROXYFSAL_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 466 of file FSAL_PROXY/fsal_lookup.c.

fsal_status_t PROXYFSAL_mkdir ( fsal_handle_t parent_directory_handle,
fsal_name_t p_dirname,
fsal_op_context_t 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 334 of file FSAL_PROXY/fsal_create.c.

fsal_status_t PROXYFSAL_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 669 of file FSAL_PROXY/fsal_create.c.

fsal_status_t PROXYFSAL_open ( fsal_handle_t filehandle,
fsal_op_context_t context,
fsal_openflags_t  openflags,
fsal_file_t file_desc,
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 309 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_open_by_fileid ( fsal_handle_t filehandle,
fsal_u64_t  fileid,
fsal_op_context_t context,
fsal_openflags_t  openflags,
fsal_file_t file_desc,
fsal_attrib_list_t file_attributes 
)

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

Parameters:
dirhandle(input): Handle of the file to be opened
fileid(input): file id for the file to be opened
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 893 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_open_by_name ( fsal_handle_t dirhandle,
fsal_name_t filename,
fsal_op_context_t context,
fsal_openflags_t  openflags,
fsal_file_t file_desc,
fsal_attrib_list_t file_attributes 
)

FSAL_open_by_name: 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 81 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_opendir ( fsal_handle_t dir_handle,
fsal_op_context_t p_context,
fsal_dir_t dir_desc,
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 64 of file FSAL_PROXY/fsal_dirs.c.

fsal_status_t PROXYFSAL_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 a file to/from a local filesystem.

Parameters:
filehandle(input): Handle of the 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)
Returns:
always ERR_FSAL_NOTSUPP for FSAL_PROXY

Todo:
: put a function in fsal_convert.c that convert your local filesystem errors to an FSAL error code. So you will have a call like : Return( unix2fsal_error(errno) , errno , INDEX_FSAL_rcp );

Definition at line 50 of file FSAL_PROXY/fsal_rcp.c.

fsal_status_t PROXYFSAL_read ( fsal_file_t file_desc,
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 proxyfsal_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 460 of file FSAL_PROXY/fsal_fileop.c.

fsal_status_t PROXYFSAL_readdir ( fsal_dir_t dir_desc,
fsal_cookie_t  start_pos,
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, ...

Todo:
: use NFS4_OP_VERIFY to implement a cache validator, BUGAZOMEU

Definition at line 125 of file FSAL_PROXY/fsal_dirs.c.

fsal_status_t PROXYFSAL_readlink ( fsal_handle_t linkhandle,
fsal_op_context_t 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 67 of file FSAL_PROXY/fsal_symlinks.c.

fsal_status_t PROXYFSAL_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 703 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_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 717 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_rename ( fsal_handle_t old_parent,
fsal_name_t p_old_name,
fsal_handle_t new_parent,
fsal_name_t p_new_name,
fsal_op_context_t 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 80 of file FSAL_PROXY/fsal_rename.c.

fsal_status_t PROXYFSAL_setattr_access ( fsal_op_context_t p_context,
fsal_attrib_list_t pcandidate_attributes,
fsal_attrib_list_t pobject_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:
p_contextuser's context.
pcandidate_attrbutesthe attributes we want to set on the object
pobject_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 219 of file FSAL_PROXY/fsal_local_op.c.

fsal_status_t PROXYFSAL_setattrs ( fsal_handle_t filehandle,
fsal_op_context_t context,
fsal_attrib_list_t attrib_set,
fsal_attrib_list_t object_attributes 
)

PROXYFSAL_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 196 of file FSAL_PROXY/fsal_attrs.c.

fsal_status_t PROXYFSAL_SetDefault_FS_specific_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 394 of file FSAL_PROXY/fsal_tools.c.

fsal_status_t PROXYFSAL_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 
)

Definition at line 675 of file FSAL_PROXY/fsal_xattrs.c.

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

Definition at line 686 of file FSAL_PROXY/fsal_xattrs.c.

fsal_status_t PROXYFSAL_symlink ( fsal_handle_t parent_directory_handle,
fsal_name_t p_linkname,
fsal_path_t p_linkcontent,
fsal_op_context_t 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 229 of file FSAL_PROXY/fsal_symlinks.c.

fsal_status_t PROXYFSAL_terminate ( )

Definition at line 162 of file FSAL_PROXY/fsal_init.c.

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

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 95 of file FSAL_PROXY/fsal_local_op.c.

fsal_status_t PROXYFSAL_truncate ( fsal_handle_t file_hdl,
fsal_op_context_t 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 67 of file FSAL_PROXY/fsal_truncate.c.

fsal_status_t PROXYFSAL_unlink ( fsal_handle_t parentdir_handle,
fsal_name_t p_object_name,
fsal_op_context_t 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 70 of file FSAL_PROXY/fsal_unlink.c.

fsal_status_t PROXYFSAL_write ( fsal_file_t file_desc,
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 proxyfsal_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 590 of file FSAL_PROXY/fsal_fileop.c.

void ReleaseTokenFSCall ( )

Definition at line 269 of file FSAL_CEPH/fsal_internal.c.

void TakeTokenFSCall ( )

Used to limit the number of simultaneous calls to Filesystem.

Definition at line 258 of file FSAL_CEPH/fsal_internal.c.


Variable Documentation

Definition at line 52 of file FSAL_CEPH/fsal_internal.c.