nfs-ganesha 1.4
Functions

fsal_local_op.c File Reference

#include "fsal.h"
#include "fsal_internal.h"
#include "fsal_convert.h"

Go to the source code of this file.

Functions

fsal_status_t CEPHFSAL_test_access (fsal_op_context_t *extcontext, fsal_accessflags_t access_type, fsal_attrib_list_t *object_attributes)

Function Documentation

fsal_status_t CEPHFSAL_test_access ( fsal_op_context_t extcontext,
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.

Definition at line 77 of file FSAL_CEPH/fsal_local_op.c.