Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
nfs3xdr.c File Reference
#include <linux/param.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/in.h>
#include <linux/pagemap.h>
#include <linux/proc_fs.h>
#include <linux/kdev_t.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfs.h>
#include <linux/nfs3.h>
#include <linux/nfs_fs.h>
#include <linux/nfsacl.h>
#include "internal.h"

Go to the source code of this file.

Macros

#define NFSDBG_FACILITY   NFSDBG_XDR
 
#define errno_NFSERR_IO   EIO
 
#define NFS3_fhandle_sz   (1+16)
 
#define NFS3_fh_sz   (NFS3_fhandle_sz) /* shorthand */
 
#define NFS3_sattr_sz   (15)
 
#define NFS3_filename_sz   (1+(NFS3_MAXNAMLEN>>2))
 
#define NFS3_path_sz   (1+(NFS3_MAXPATHLEN>>2))
 
#define NFS3_fattr_sz   (21)
 
#define NFS3_cookieverf_sz   (NFS3_COOKIEVERFSIZE>>2)
 
#define NFS3_wcc_attr_sz   (6)
 
#define NFS3_pre_op_attr_sz   (1+NFS3_wcc_attr_sz)
 
#define NFS3_post_op_attr_sz   (1+NFS3_fattr_sz)
 
#define NFS3_wcc_data_sz   (NFS3_pre_op_attr_sz+NFS3_post_op_attr_sz)
 
#define NFS3_diropargs_sz   (NFS3_fh_sz+NFS3_filename_sz)
 
#define NFS3_getattrargs_sz   (NFS3_fh_sz)
 
#define NFS3_setattrargs_sz   (NFS3_fh_sz+NFS3_sattr_sz+3)
 
#define NFS3_lookupargs_sz   (NFS3_fh_sz+NFS3_filename_sz)
 
#define NFS3_accessargs_sz   (NFS3_fh_sz+1)
 
#define NFS3_readlinkargs_sz   (NFS3_fh_sz)
 
#define NFS3_readargs_sz   (NFS3_fh_sz+3)
 
#define NFS3_writeargs_sz   (NFS3_fh_sz+5)
 
#define NFS3_createargs_sz   (NFS3_diropargs_sz+NFS3_sattr_sz)
 
#define NFS3_mkdirargs_sz   (NFS3_diropargs_sz+NFS3_sattr_sz)
 
#define NFS3_symlinkargs_sz   (NFS3_diropargs_sz+1+NFS3_sattr_sz)
 
#define NFS3_mknodargs_sz   (NFS3_diropargs_sz+2+NFS3_sattr_sz)
 
#define NFS3_removeargs_sz   (NFS3_fh_sz+NFS3_filename_sz)
 
#define NFS3_renameargs_sz   (NFS3_diropargs_sz+NFS3_diropargs_sz)
 
#define NFS3_linkargs_sz   (NFS3_fh_sz+NFS3_diropargs_sz)
 
#define NFS3_readdirargs_sz   (NFS3_fh_sz+NFS3_cookieverf_sz+3)
 
#define NFS3_readdirplusargs_sz   (NFS3_fh_sz+NFS3_cookieverf_sz+4)
 
#define NFS3_commitargs_sz   (NFS3_fh_sz+3)
 
#define NFS3_getattrres_sz   (1+NFS3_fattr_sz)
 
#define NFS3_setattrres_sz   (1+NFS3_wcc_data_sz)
 
#define NFS3_removeres_sz   (NFS3_setattrres_sz)
 
#define NFS3_lookupres_sz   (1+NFS3_fh_sz+(2 * NFS3_post_op_attr_sz))
 
#define NFS3_accessres_sz   (1+NFS3_post_op_attr_sz+1)
 
#define NFS3_readlinkres_sz   (1+NFS3_post_op_attr_sz+1)
 
#define NFS3_readres_sz   (1+NFS3_post_op_attr_sz+3)
 
#define NFS3_writeres_sz   (1+NFS3_wcc_data_sz+4)
 
#define NFS3_createres_sz   (1+NFS3_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
 
#define NFS3_renameres_sz   (1+(2 * NFS3_wcc_data_sz))
 
#define NFS3_linkres_sz   (1+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
 
#define NFS3_readdirres_sz   (1+NFS3_post_op_attr_sz+2)
 
#define NFS3_fsstatres_sz   (1+NFS3_post_op_attr_sz+13)
 
#define NFS3_fsinfores_sz   (1+NFS3_post_op_attr_sz+12)
 
#define NFS3_pathconfres_sz   (1+NFS3_post_op_attr_sz+6)
 
#define NFS3_commitres_sz   (1+NFS3_wcc_data_sz+2)
 
#define ACL3_getaclargs_sz   (NFS3_fh_sz+1)
 
#define ACL3_setaclargs_sz
 
#define ACL3_getaclres_sz
 
#define ACL3_setaclres_sz   (1+NFS3_post_op_attr_sz)
 
#define NFS3_OK   NFS_OK
 
#define PROC(proc, argtype, restype, timer)
 

Functions

int nfs3_decode_dirent (struct xdr_stream *xdr, struct nfs_entry *entry, int plus)
 

Variables

struct rpc_procinfo nfs3_procedures []
 
struct rpc_version nfs_version3
 

Macro Definition Documentation

#define ACL3_getaclargs_sz   (NFS3_fh_sz+1)

Definition at line 82 of file nfs3xdr.c.

#define ACL3_getaclres_sz
Value:

Definition at line 85 of file nfs3xdr.c.

#define ACL3_setaclargs_sz
Value:
XDR_QUADLEN(NFS_ACL_INLINE_BUFSIZE))

Definition at line 83 of file nfs3xdr.c.

#define ACL3_setaclres_sz   (1+NFS3_post_op_attr_sz)

Definition at line 87 of file nfs3xdr.c.

#define errno_NFSERR_IO   EIO

Definition at line 28 of file nfs3xdr.c.

#define NFS3_accessargs_sz   (NFS3_fh_sz+1)

Definition at line 50 of file nfs3xdr.c.

#define NFS3_accessres_sz   (1+NFS3_post_op_attr_sz+1)

Definition at line 69 of file nfs3xdr.c.

#define NFS3_commitargs_sz   (NFS3_fh_sz+3)

Definition at line 63 of file nfs3xdr.c.

#define NFS3_commitres_sz   (1+NFS3_wcc_data_sz+2)

Definition at line 80 of file nfs3xdr.c.

#define NFS3_cookieverf_sz   (NFS3_COOKIEVERFSIZE>>2)

Definition at line 40 of file nfs3xdr.c.

#define NFS3_createargs_sz   (NFS3_diropargs_sz+NFS3_sattr_sz)

Definition at line 54 of file nfs3xdr.c.

#define NFS3_createres_sz   (1+NFS3_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)

Definition at line 73 of file nfs3xdr.c.

#define NFS3_diropargs_sz   (NFS3_fh_sz+NFS3_filename_sz)

Definition at line 45 of file nfs3xdr.c.

#define NFS3_fattr_sz   (21)

Definition at line 39 of file nfs3xdr.c.

#define NFS3_fh_sz   (NFS3_fhandle_sz) /* shorthand */

Definition at line 35 of file nfs3xdr.c.

#define NFS3_fhandle_sz   (1+16)

Definition at line 34 of file nfs3xdr.c.

#define NFS3_filename_sz   (1+(NFS3_MAXNAMLEN>>2))

Definition at line 37 of file nfs3xdr.c.

#define NFS3_fsinfores_sz   (1+NFS3_post_op_attr_sz+12)

Definition at line 78 of file nfs3xdr.c.

#define NFS3_fsstatres_sz   (1+NFS3_post_op_attr_sz+13)

Definition at line 77 of file nfs3xdr.c.

#define NFS3_getattrargs_sz   (NFS3_fh_sz)

Definition at line 47 of file nfs3xdr.c.

#define NFS3_getattrres_sz   (1+NFS3_fattr_sz)

Definition at line 65 of file nfs3xdr.c.

#define NFS3_linkargs_sz   (NFS3_fh_sz+NFS3_diropargs_sz)

Definition at line 60 of file nfs3xdr.c.

#define NFS3_linkres_sz   (1+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)

Definition at line 75 of file nfs3xdr.c.

#define NFS3_lookupargs_sz   (NFS3_fh_sz+NFS3_filename_sz)

Definition at line 49 of file nfs3xdr.c.

#define NFS3_lookupres_sz   (1+NFS3_fh_sz+(2 * NFS3_post_op_attr_sz))

Definition at line 68 of file nfs3xdr.c.

#define NFS3_mkdirargs_sz   (NFS3_diropargs_sz+NFS3_sattr_sz)

Definition at line 55 of file nfs3xdr.c.

#define NFS3_mknodargs_sz   (NFS3_diropargs_sz+2+NFS3_sattr_sz)

Definition at line 57 of file nfs3xdr.c.

#define NFS3_OK   NFS_OK

Definition at line 360 of file nfs3xdr.c.

#define NFS3_path_sz   (1+(NFS3_MAXPATHLEN>>2))

Definition at line 38 of file nfs3xdr.c.

#define NFS3_pathconfres_sz   (1+NFS3_post_op_attr_sz+6)

Definition at line 79 of file nfs3xdr.c.

#define NFS3_post_op_attr_sz   (1+NFS3_fattr_sz)

Definition at line 43 of file nfs3xdr.c.

#define NFS3_pre_op_attr_sz   (1+NFS3_wcc_attr_sz)

Definition at line 42 of file nfs3xdr.c.

#define NFS3_readargs_sz   (NFS3_fh_sz+3)

Definition at line 52 of file nfs3xdr.c.

#define NFS3_readdirargs_sz   (NFS3_fh_sz+NFS3_cookieverf_sz+3)

Definition at line 61 of file nfs3xdr.c.

#define NFS3_readdirplusargs_sz   (NFS3_fh_sz+NFS3_cookieverf_sz+4)

Definition at line 62 of file nfs3xdr.c.

#define NFS3_readdirres_sz   (1+NFS3_post_op_attr_sz+2)

Definition at line 76 of file nfs3xdr.c.

#define NFS3_readlinkargs_sz   (NFS3_fh_sz)

Definition at line 51 of file nfs3xdr.c.

#define NFS3_readlinkres_sz   (1+NFS3_post_op_attr_sz+1)

Definition at line 70 of file nfs3xdr.c.

#define NFS3_readres_sz   (1+NFS3_post_op_attr_sz+3)

Definition at line 71 of file nfs3xdr.c.

#define NFS3_removeargs_sz   (NFS3_fh_sz+NFS3_filename_sz)

Definition at line 58 of file nfs3xdr.c.

#define NFS3_removeres_sz   (NFS3_setattrres_sz)

Definition at line 67 of file nfs3xdr.c.

#define NFS3_renameargs_sz   (NFS3_diropargs_sz+NFS3_diropargs_sz)

Definition at line 59 of file nfs3xdr.c.

#define NFS3_renameres_sz   (1+(2 * NFS3_wcc_data_sz))

Definition at line 74 of file nfs3xdr.c.

#define NFS3_sattr_sz   (15)

Definition at line 36 of file nfs3xdr.c.

#define NFS3_setattrargs_sz   (NFS3_fh_sz+NFS3_sattr_sz+3)

Definition at line 48 of file nfs3xdr.c.

#define NFS3_setattrres_sz   (1+NFS3_wcc_data_sz)

Definition at line 66 of file nfs3xdr.c.

#define NFS3_symlinkargs_sz   (NFS3_diropargs_sz+1+NFS3_sattr_sz)

Definition at line 56 of file nfs3xdr.c.

#define NFS3_wcc_attr_sz   (6)

Definition at line 41 of file nfs3xdr.c.

#define NFS3_wcc_data_sz   (NFS3_pre_op_attr_sz+NFS3_post_op_attr_sz)

Definition at line 44 of file nfs3xdr.c.

#define NFS3_writeargs_sz   (NFS3_fh_sz+5)

Definition at line 53 of file nfs3xdr.c.

#define NFS3_writeres_sz   (1+NFS3_wcc_data_sz+4)

Definition at line 72 of file nfs3xdr.c.

#define NFSDBG_FACILITY   NFSDBG_XDR

Definition at line 25 of file nfs3xdr.c.

#define PROC (   proc,
  argtype,
  restype,
  timer 
)
Value:
[NFS3PROC_##proc] = { \
.p_proc = NFS3PROC_##proc, \
.p_encode = (kxdreproc_t)nfs3_xdr_enc_##argtype##3args, \
.p_decode = (kxdrdproc_t)nfs3_xdr_dec_##restype##3res, \
.p_arglen = NFS3_##argtype##args_sz, \
.p_replen = NFS3_##restype##res_sz, \
.p_timer = timer, \
.p_statidx = NFS3PROC_##proc, \
.p_name = #proc, \
}

Definition at line 2477 of file nfs3xdr.c.

Function Documentation

int nfs3_decode_dirent ( struct xdr_stream *  xdr,
struct nfs_entry entry,
int  plus 
)

nfs3_decode_dirent - Decode a single NFSv3 directory entry stored in the local page cache : XDR stream where entry resides : buffer to fill in with entry data : boolean indicating whether this should be a readdirplus entry

Returns zero if successful, otherwise a negative errno value is returned.

This function is not invoked during READDIR reply decoding, but rather whenever an application invokes the getdents(2) system call on a directory already in our cache.

3.3.16 entry3

struct entry3 { fileid3 fileid; filename3 name; cookie3 cookie; fhandle3 filehandle; post_op_attr3 attributes; entry3 *nextentry; };

3.3.17 entryplus3 struct entryplus3 { fileid3 fileid; filename3 name; cookie3 cookie; post_op_attr name_attributes; post_op_fh3 name_handle; entryplus3 *nextentry; };

Definition at line 1936 of file nfs3xdr.c.

Variable Documentation

int errno

Definition at line 2419 of file nfs3xdr.c.

struct rpc_procinfo nfs3_procedures[]
Initial value:
= {
PROC(GETATTR, getattr, getattr, 1),
PROC(SETATTR, setattr, setattr, 0),
PROC(LOOKUP, lookup, lookup, 2),
PROC(ACCESS, access, access, 1),
PROC(READLINK, readlink, readlink, 3),
PROC(READ, read, read, 3),
PROC(MKDIR, mkdir, create, 0),
PROC(SYMLINK, symlink, create, 0),
PROC(MKNOD, mknod, create, 0),
PROC(REMOVE, remove, remove, 0),
PROC(RMDIR, lookup, setattr, 0),
PROC(RENAME, rename, rename, 0),
PROC(LINK, link, link, 0),
PROC(READDIR, readdir, readdir, 3),
PROC(READDIRPLUS, readdirplus, readdir, 3),
PROC(FSSTAT, getattr, fsstat, 0),
PROC(FSINFO, getattr, fsinfo, 0),
PROC(PATHCONF, getattr, pathconf, 0),
PROC(COMMIT, commit, commit, 5),
}

Definition at line 2489 of file nfs3xdr.c.

struct rpc_version nfs_version3
Initial value:
= {
.number = 3,
.procs = nfs3_procedures
}

Definition at line 2513 of file nfs3xdr.c.

Definition at line 2418 of file nfs3xdr.c.