nfs-ganesha 1.4
Defines | Functions

fsal_dirs.c File Reference

#include <string.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include "nfs4.h"
#include "abstract_mem.h"
#include "fsal_internal.h"
#include "fsal_convert.h"
#include "fsal_common.h"
#include "nfs_proto_functions.h"
#include "fsal_nfsv4_macros.h"

Go to the source code of this file.

Defines

#define FSAL_READDIR_NB_OP_ALLOC   2
#define FSAL_READDIR_IDX_OP_PUTFH   0
#define FSAL_READDIR_IDX_OP_READDIR   1

Functions

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_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_status_t PROXYFSAL_closedir (fsal_dir_t *dir_descriptor)

Define Documentation

#define FSAL_READDIR_IDX_OP_PUTFH   0
#define FSAL_READDIR_IDX_OP_READDIR   1
#define FSAL_READDIR_NB_OP_ALLOC   2

Function Documentation

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