nfs-ganesha 1.4
Defines | Functions

fsal_convert.h File Reference

#include "fsal.h"

Go to the source code of this file.

Defines

#define fsal2posix_time(_time_)   ((time_t)(_time_).seconds)
#define high32m(a)   ( (unsigned int)( a >> 32 ) )
#define low32m(a)   ( (unsigned int)a )

Functions

int posix2fsal_error (int posix_errorcode)
int fsal2posix_openflags (fsal_openflags_t fsal_flags, int *p_posix_flags)
int fsal2posix_testperm (fsal_accessflags_t testperm)
fsal_status_t posix2fsal_attributes (struct stat *p_buffstat, fsal_attrib_list_t *p_fsalattr_out)
mode_t fsal2unix_mode (fsal_accessmode_t fsal_mode)
fsal_accessmode_t unix2fsal_mode (mode_t unix_mode)
fsal_nodetype_t posix2fsal_type (mode_t posix_type_in)
fsal_fsid_t posix2fsal_fsid (dev_t posix_devid)
fsal_time_t posix2fsal_time (time_t tsec)

Define Documentation

#define fsal2posix_time (   _time_)    ((time_t)(_time_).seconds)

fsal2posix_time: Converts FSAL time structure (fsal_time_t) to POSIX time type (time_t).

Definition at line 54 of file FSAL/FSAL_LUSTRE/fsal_convert.h.

#define high32m (   a)    ( (unsigned int)( a >> 32 ) )

Definition at line 56 of file FSAL/FSAL_LUSTRE/fsal_convert.h.

#define low32m (   a)    ( (unsigned int)a )

Definition at line 57 of file FSAL/FSAL_LUSTRE/fsal_convert.h.


Function Documentation

int fsal2posix_openflags ( fsal_openflags_t  fsal_flags,
int *  p_posix_flags 
)

converts an fsal open flag to an hpss open flag.

fsal2posix_openflags: Convert FSAL open flags to Posix open flags.

Parameters:
fsal_flags(input): The FSAL open flags to be translated.
posix_flags(output): Pointer to the POSIX open flags.
Returns:
- ERR_FSAL_NO_ERROR (no error).
  • ERR_FSAL_FAULT (posix_flags is a NULL pointer).
  • ERR_FSAL_INVAL (invalid or incompatible input flags).

fsal2posix_openflags: Convert FSAL open flags to Posix open flags.

Parameters:
fsal_flags(input): The FSAL open flags to be translated.
p_hpss_flags(output): Pointer to the POSIX open flags.
Returns:
- ERR_FSAL_NO_ERROR (no error).
  • ERR_FSAL_FAULT (p_hpss_flags is a NULL pointer).
  • ERR_FSAL_INVAL (invalid or incompatible input flags).

converts an fsal open flag to an vfs open flag.

fsal2posix_openflags: Convert FSAL open flags to Posix open flags.

Parameters:
fsal_flags(input): The FSAL open flags to be translated.
posix_flags(output): Pointer to the POSIX open flags.
Returns:
- ERR_FSAL_NO_ERROR (no error).
  • ERR_FSAL_FAULT (posix_flags is a NULL pointer).
  • ERR_FSAL_INVAL (invalid or incompatible input flags).

fsal2posix_openflags: Convert FSAL open flags to Posix open flags.

Parameters:
fsal_flags(input): The FSAL open flags to be translated.
p_hpss_flags(output): Pointer to the POSIX open flags.
Returns:
- ERR_FSAL_NO_ERROR (no error).
  • ERR_FSAL_FAULT (p_hpss_flags is a NULL pointer).
  • ERR_FSAL_INVAL (invalid or incompatible input flags).

fsal2posix_openflags: Convert FSAL open flags to Posix open flags.

Parameters:
fsal_flags(input): The FSAL open flags to be translated.
p_posix_flags(output): Pointer to the POSIX open flags.
Returns:
- ERR_FSAL_NO_ERROR (no error).
  • ERR_FSAL_FAULT (p_hpss_flags is a NULL pointer).
  • ERR_FSAL_INVAL (invalid or incompatible input flags).

Definition at line 175 of file FSAL_CEPH/fsal_convert.c.

int fsal2posix_testperm ( fsal_accessflags_t  testperm)

converts an FSAL permission test to a Posix permission test.

fsal2posix_testperm: Convert FSAL permission flags to Posix permission flags.

Parameters:
testperm(input): The FSAL permission flags to be tested.
Returns:
The POSIX permission flags to be tested.

Definition at line 37 of file fsal_convert.c.

mode_t fsal2unix_mode ( fsal_accessmode_t  fsal_mode)

converts FSAL access mode to unix 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 posix2fsal_attributes ( struct stat *  p_buffstat,
fsal_attrib_list_t p_fsalattr_out 
)

Converts POSIX attributes (struct stat) to FSAL attributes (fsal_attrib_list_t)

Definition at line 229 of file FSAL_CEPH/fsal_convert.c.

int posix2fsal_error ( int  posix_errorcode)

posix2fsal_error : Convert POSIX error codes to FSAL error codes.

Parameters:
posix_errorcode(input): The error code returned from POSIX.
Returns:
The FSAL error code associated to posix_errorcode.

Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).
Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).
Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).
Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).
Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).
Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).
Todo:
: The EBADF error also happens when file is opened for reading, and we try writting in it. In this case, we return ERR_FSAL_NOT_OPENED, but it doesn't seems to be a correct error translation.
Warning:
AIX returns EEXIST where BSD uses ENOTEMPTY; We want ENOTEMPTY to be interpreted anyway on AIX plateforms. Thus, we explicitely write its value (87).

Definition at line 40 of file FSAL_CEPH/fsal_convert.c.

fsal_fsid_t posix2fsal_fsid ( dev_t  posix_devid)

converts posix fsid to fsal FSid.

Definition at line 199 of file fsal_convert.c.

fsal_time_t posix2fsal_time ( time_t  tsec)

posix2fsal_time: Convert POSIX time structure (time_t) to FSAL time type (fsal_time_t).

fsal_nodetype_t posix2fsal_type ( mode_t  posix_type_in)

converts hpss object type to fsal object type.

posix2fsal_type: Convert posix object type to FSAL node type.

Parameters:
posix_type_in(input): The POSIX object type.
Returns:
- The FSAL node type associated to posix_type_in.
  • -1 if the input type is unknown.

Definition at line 155 of file fsal_convert.c.

fsal_accessmode_t unix2fsal_mode ( mode_t  unix_mode)

converts unix access mode to fsal 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.