|
nfs-ganesha 1.4
|
A set of functions used to managed NFS. More...
#include <stdio.h>#include <string.h>#include <pthread.h>#include <fcntl.h>#include <sys/file.h>#include <pwd.h>#include <grp.h>#include <stdint.h>#include "HashData.h"#include "HashTable.h"#include "log.h"#include "ganesha_rpc.h"#include "nfs23.h"#include "nfs4.h"#include "mount.h"#include "nfs_core.h"#include "cache_inode.h"#include "nfs_exports.h"#include "nfs_creds.h"#include "nfs_proto_functions.h"#include "nfs_tools.h"#include "nfs_file_handle.h"#include "nfs_proto_tools.h"#include "nfs4_acls.h"Go to the source code of this file.
A set of functions used to managed NFS.
nfs_proto_tools.c - A set of functions used to managed NFS.
Definition in file nfs_proto_tools.c.
| #define MAXATTR FATTR4_MOUNTED_ON_FILEID |
| void nfs3_access_debug | ( | char * | label, |
| uint32_t | access | ||
| ) |
Definition at line 4322 of file nfs_proto_tools.c.
| void nfs4_access_debug | ( | char * | label, |
| uint32_t | access, | ||
| fsal_aceperm_t | v4mask | ||
| ) |
Definition at line 4334 of file nfs_proto_tools.c.
| void nfs4_Fattr_Free | ( | fattr4 * | fattr | ) |
Definition at line 786 of file nfs_proto_tools.c.
| int nfs4_FhandleToExId | ( | nfs_fh4 * | fh4p, |
| unsigned short * | ExIdp | ||
| ) |
nfs4_FhandleToExId
This routine extracts the export id from the filehandle
| fh4p | [IN] pointer to file handle to be used. |
| ExIdp | [OUT] pointer to buffer in which found export id will be stored. |
Definition at line 2033 of file nfs_proto_tools.c.
| nfsstat4 nfs4_sanity_check_FH | ( | compound_data_t * | data, |
| cache_inode_file_type_t | required_type | ||
| ) |
nfs4_sanity_check_FH: Do basic checks on a filehandle
This function performs basic checks to make sure the supplied filehandle is sane for a given operation.
| data | [IN] Compound_data_t for the operation to check |
| required_type | [IN] The file type this operation requires. Set to 0 to allow any type. |
Definition at line 4377 of file nfs_proto_tools.c.
| cache_entry_t* nfs_FhandleToCache | ( | u_long | rq_vers, |
| fhandle2 * | pfh2, | ||
| nfs_fh3 * | pfh3, | ||
| nfs_fh4 * | pfh4, | ||
| nfsstat2 * | pstatus2, | ||
| nfsstat3 * | pstatus3, | ||
| nfsstat4 * | pstatus4, | ||
| fsal_attrib_list_t * | pattr, | ||
| fsal_op_context_t * | pcontext, | ||
| int * | prc | ||
| ) |
nfs_FhandleToCache: Gets a cache entry using a file handle (v2/3/4) as input.
Gets a cache entry using a file handle (v2/3/4) as input.
If a cache entry is returned, its refcount is +1.
| rq_vers | [IN] version of the NFS protocol to be used |
| pfh2 | [IN] NFSv2 file handle or NULL |
| pfh3 | [IN] NFSv3 file handle or NULL |
| pfh4 | [IN] NFSv4 file handle or NULL |
| pstatus2 | [OUT] pointer to NFSv2 status or NULL |
| pstatus3 | [OUT] pointer to NFSv3 status or NULL |
| pstatus4 | [OUT] pointer to NFSv4 status or NULL |
| pattr | [OUT] FSAL attributes related to this cache entry |
| pcontext | [IN] client's FSAL credentials |
| pclient | [IN] client's ressources to be used for accessing the Cache Inode |
| prc | [OUT] internal status for the request (NFS_REQ_DROP or NFS_REQ_OK) |
Definition at line 194 of file nfs_proto_tools.c.
| void nfs_FhandleToStr | ( | u_long | rq_vers, |
| fhandle2 * | pfh2, | ||
| nfs_fh3 * | pfh3, | ||
| nfs_fh4 * | pfh4, | ||
| char * | str | ||
| ) |
nfs_FhandleToStr: Converts a file handle to a string representation.
Converts a file handle to a string representation.
| rq_vers | [IN] version of the NFS protocol to be used |
| pfh2 | [IN] NFSv2 file handle or NULL |
| pfh3 | [IN] NFSv3 file handle or NULL |
| pfh4 | [IN] NFSv4 file handle or NULL |
| str | [OUT] string version of handle |
Definition at line 148 of file nfs_proto_tools.c.
| fsal_accessflags_t nfs_get_access_mask | ( | uint32_t | op, |
| fsal_attrib_list_t * | pattr | ||
| ) |
Definition at line 4266 of file nfs_proto_tools.c.
| int nfs_RetryableError | ( | cache_inode_status_t | cache_status | ) |
nfs_RetryableError: Indicates if an error is retryable or not.
Indicates if an error is retryable or not.
| cache_status | [IN] input Cache Inode Status value, to be tested. |
Definition at line 408 of file nfs_proto_tools.c.
| void nfs_SetFailedStatus | ( | fsal_op_context_t * | pcontext, |
| exportlist_t * | pexport, | ||
| int | version, | ||
| cache_inode_status_t | status, | ||
| nfsstat2 * | pstatus2, | ||
| nfsstat3 * | pstatus3, | ||
| cache_entry_t * | pentry0, | ||
| post_op_attr * | ppost_op_attr, | ||
| cache_entry_t * | pentry1, | ||
| fsal_attrib_list_t * | ppre_vattr1, | ||
| wcc_data * | pwcc_data1, | ||
| cache_entry_t * | pentry2, | ||
| fsal_attrib_list_t * | ppre_vattr2, | ||
| wcc_data * | pwcc_data2 | ||
| ) |
Definition at line 510 of file nfs_proto_tools.c.
| int nfs_SetPostOpAttr | ( | exportlist_t * | pexport, |
| const fsal_attrib_list_t * | pfsal_attr, | ||
| post_op_attr * | presult | ||
| ) |
nfs_SetPostOpAttr: Converts FSAL Attributes to NFSv3 PostOp Attributes structure.
Converts FSAL Attributes to NFSv3 PostOp Attributes structure.
| pexport | [IN] the related export entry |
| pfsal_attr | [IN] FSAL attributes |
| pattr | [OUT] NFSv3 PostOp structure attributes. |
Definition at line 315 of file nfs_proto_tools.c.
| void nfs_SetPreOpAttr | ( | fsal_attrib_list_t * | pfsal_attr, |
| pre_op_attr * | pattr | ||
| ) |
nfs_SetPreOpAttr: Converts FSAL Attributes to NFSv3 PreOp Attributes structure.
Converts FSAL Attributes to NFSv3 PreOp Attributes structure.
| pfsal_attr | [IN] FSAL attributes. |
| pattr | [OUT] NFSv3 PreOp structure attributes. |
Definition at line 350 of file nfs_proto_tools.c.
| void nfs_SetWccData | ( | exportlist_t * | pexport, |
| fsal_attrib_list_t * | pbefore_attr, | ||
| fsal_attrib_list_t * | pafter_attr, | ||
| wcc_data * | pwcc_data | ||
| ) |
nfs_SetWccData: Sets NFSv3 Weak Cache Coherency structure.
Sets NFSv3 Weak Cache Coherency structure.
| pexport | [IN] export entry |
| pentry | [IN] related pentry |
| pbefore_attr | [IN] the attributes before the operation. |
| pafter_attr | [IN] the attributes after the operation |
| pwcc_data | [OUT] the Weak Cache Coherency structure |
Definition at line 384 of file nfs_proto_tools.c.
| char* mnt_function_names[] |
{
"MNT_null", "MNT_mount", "MNT_dump", "MNT_umount", "MNT_umountall", "MNT_export"
}
Definition at line 126 of file nfs_proto_tools.c.
| char* nfsv2_function_names[] |
{
"NFSv2_null", "NFSv2_getattr", "NFSv2_setattr", "NFSv2_root",
"NFSv2_lookup", "NFSv2_readlink", "NFSv2_read", "NFSv2_writecache",
"NFSv2_write", "NFSv2_create", "NFSv2_remove", "NFSv2_rename",
"NFSv2_link", "NFSv2_symlink", "NFSv2_mkdir", "NFSv2_rmdir",
"NFSv2_readdir", "NFSv2_statfs"
}
Definition at line 105 of file nfs_proto_tools.c.
| char* nfsv3_function_names[] |
{
"NFSv3_null", "NFSv3_getattr", "NFSv3_setattr", "NFSv3_lookup",
"NFSv3_access", "NFSv3_readlink", "NFSv3_read", "NFSv3_write",
"NFSv3_create", "NFSv3_mkdir", "NFSv3_symlink", "NFSv3_mknod",
"NFSv3_remove", "NFSv3_rmdir", "NFSv3_rename", "NFSv3_link",
"NFSv3_readdir", "NFSv3_readdirplus", "NFSv3_fsstat",
"NFSv3_fsinfo", "NFSv3_pathconf", "NFSv3_commit"
}
Definition at line 113 of file nfs_proto_tools.c.
| char* nfsv4_function_names[] |
{
"NFSv4_null", "NFSv4_compound"
}
Definition at line 122 of file nfs_proto_tools.c.
| char* rquota_functions_names[] |
{
"rquota_Null", "rquota_getquota", "rquota_getquotaspecific", "rquota_setquota",
"rquota_setquotaspecific"
}
Definition at line 130 of file nfs_proto_tools.c.
1.7.3