Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
nfs2xdr.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/sunrpc/clnt.h>
#include <linux/nfs.h>
#include <linux/nfs2.h>
#include <linux/nfs_fs.h>
#include "internal.h"

Go to the source code of this file.

Macros

#define NFSDBG_FACILITY   NFSDBG_XDR
 
#define errno_NFSERR_IO   EIO
 
#define NFS_fhandle_sz   (8)
 
#define NFS_sattr_sz   (8)
 
#define NFS_filename_sz   (1+(NFS2_MAXNAMLEN>>2))
 
#define NFS_path_sz   (1+(NFS2_MAXPATHLEN>>2))
 
#define NFS_fattr_sz   (17)
 
#define NFS_info_sz   (5)
 
#define NFS_entry_sz   (NFS_filename_sz+3)
 
#define NFS_diropargs_sz   (NFS_fhandle_sz+NFS_filename_sz)
 
#define NFS_removeargs_sz   (NFS_fhandle_sz+NFS_filename_sz)
 
#define NFS_sattrargs_sz   (NFS_fhandle_sz+NFS_sattr_sz)
 
#define NFS_readlinkargs_sz   (NFS_fhandle_sz)
 
#define NFS_readargs_sz   (NFS_fhandle_sz+3)
 
#define NFS_writeargs_sz   (NFS_fhandle_sz+4)
 
#define NFS_createargs_sz   (NFS_diropargs_sz+NFS_sattr_sz)
 
#define NFS_renameargs_sz   (NFS_diropargs_sz+NFS_diropargs_sz)
 
#define NFS_linkargs_sz   (NFS_fhandle_sz+NFS_diropargs_sz)
 
#define NFS_symlinkargs_sz   (NFS_diropargs_sz+1+NFS_sattr_sz)
 
#define NFS_readdirargs_sz   (NFS_fhandle_sz+2)
 
#define NFS_attrstat_sz   (1+NFS_fattr_sz)
 
#define NFS_diropres_sz   (1+NFS_fhandle_sz+NFS_fattr_sz)
 
#define NFS_readlinkres_sz   (2)
 
#define NFS_readres_sz   (1+NFS_fattr_sz+1)
 
#define NFS_writeres_sz   (NFS_attrstat_sz)
 
#define NFS_stat_sz   (1)
 
#define NFS_readdirres_sz   (1)
 
#define NFS_statfsres_sz   (1+NFS_info_sz)
 
#define NFS2_SATTR_NOT_SET   (0xffffffff)
 
#define PROC(proc, argtype, restype, timer)
 

Functions

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

Variables

struct rpc_procinfo nfs_procedures []
 
struct rpc_version nfs_version2
 

Macro Definition Documentation

#define errno_NFSERR_IO   EIO

Definition at line 29 of file nfs2xdr.c.

#define NFS2_SATTR_NOT_SET   (0xffffffff)

Definition at line 335 of file nfs2xdr.c.

#define NFS_attrstat_sz   (1+NFS_fattr_sz)

Definition at line 55 of file nfs2xdr.c.

#define NFS_createargs_sz   (NFS_diropargs_sz+NFS_sattr_sz)

Definition at line 49 of file nfs2xdr.c.

#define NFS_diropargs_sz   (NFS_fhandle_sz+NFS_filename_sz)

Definition at line 43 of file nfs2xdr.c.

#define NFS_diropres_sz   (1+NFS_fhandle_sz+NFS_fattr_sz)

Definition at line 56 of file nfs2xdr.c.

#define NFS_entry_sz   (NFS_filename_sz+3)

Definition at line 41 of file nfs2xdr.c.

#define NFS_fattr_sz   (17)

Definition at line 39 of file nfs2xdr.c.

#define NFS_fhandle_sz   (8)

Definition at line 35 of file nfs2xdr.c.

#define NFS_filename_sz   (1+(NFS2_MAXNAMLEN>>2))

Definition at line 37 of file nfs2xdr.c.

#define NFS_info_sz   (5)

Definition at line 40 of file nfs2xdr.c.

#define NFS_linkargs_sz   (NFS_fhandle_sz+NFS_diropargs_sz)

Definition at line 51 of file nfs2xdr.c.

#define NFS_path_sz   (1+(NFS2_MAXPATHLEN>>2))

Definition at line 38 of file nfs2xdr.c.

#define NFS_readargs_sz   (NFS_fhandle_sz+3)

Definition at line 47 of file nfs2xdr.c.

#define NFS_readdirargs_sz   (NFS_fhandle_sz+2)

Definition at line 53 of file nfs2xdr.c.

#define NFS_readdirres_sz   (1)

Definition at line 61 of file nfs2xdr.c.

#define NFS_readlinkargs_sz   (NFS_fhandle_sz)

Definition at line 46 of file nfs2xdr.c.

#define NFS_readlinkres_sz   (2)

Definition at line 57 of file nfs2xdr.c.

#define NFS_readres_sz   (1+NFS_fattr_sz+1)

Definition at line 58 of file nfs2xdr.c.

#define NFS_removeargs_sz   (NFS_fhandle_sz+NFS_filename_sz)

Definition at line 44 of file nfs2xdr.c.

#define NFS_renameargs_sz   (NFS_diropargs_sz+NFS_diropargs_sz)

Definition at line 50 of file nfs2xdr.c.

#define NFS_sattr_sz   (8)

Definition at line 36 of file nfs2xdr.c.

#define NFS_sattrargs_sz   (NFS_fhandle_sz+NFS_sattr_sz)

Definition at line 45 of file nfs2xdr.c.

#define NFS_stat_sz   (1)

Definition at line 60 of file nfs2xdr.c.

#define NFS_statfsres_sz   (1+NFS_info_sz)

Definition at line 62 of file nfs2xdr.c.

#define NFS_symlinkargs_sz   (NFS_diropargs_sz+1+NFS_sattr_sz)

Definition at line 52 of file nfs2xdr.c.

#define NFS_writeargs_sz   (NFS_fhandle_sz+4)

Definition at line 48 of file nfs2xdr.c.

#define NFS_writeres_sz   (NFS_attrstat_sz)

Definition at line 59 of file nfs2xdr.c.

#define NFSDBG_FACILITY   NFSDBG_XDR

Definition at line 26 of file nfs2xdr.c.

#define PROC (   proc,
  argtype,
  restype,
  timer 
)
Value:
[NFSPROC_##proc] = { \
.p_proc = NFSPROC_##proc, \
.p_encode = (kxdreproc_t)nfs2_xdr_enc_##argtype, \
.p_decode = (kxdrdproc_t)nfs2_xdr_dec_##restype, \
.p_arglen = NFS_##argtype##_sz, \
.p_replen = NFS_##restype##_sz, \
.p_timer = timer, \
.p_statidx = NFSPROC_##proc, \
.p_name = #proc, \
}

Definition at line 1105 of file nfs2xdr.c.

Function Documentation

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

nfs2_decode_dirent - Decode a single NFSv2 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.

2.2.17. entry

struct entry { unsigned fileid; filename name; nfscookie cookie; entry *nextentry; };

Definition at line 902 of file nfs2xdr.c.

Variable Documentation

int errno

Definition at line 1048 of file nfs2xdr.c.

struct rpc_procinfo nfs_procedures[]
Initial value:
= {
PROC(GETATTR, fhandle, attrstat, 1),
PROC(SETATTR, sattrargs, attrstat, 0),
PROC(LOOKUP, diropargs, diropres, 2),
PROC(READLINK, readlinkargs, readlinkres, 3),
PROC(READ, readargs, readres, 3),
PROC(WRITE, writeargs, writeres, 4),
PROC(CREATE, createargs, diropres, 0),
PROC(REMOVE, removeargs, stat, 0),
PROC(RENAME, renameargs, stat, 0),
PROC(LINK, linkargs, stat, 0),
PROC(SYMLINK, symlinkargs, stat, 0),
PROC(MKDIR, createargs, diropres, 0),
PROC(RMDIR, diropargs, stat, 0),
PROC(READDIR, readdirargs, readdirres, 3),
PROC(STATFS, fhandle, statfsres, 0),
}

Definition at line 1116 of file nfs2xdr.c.

struct rpc_version nfs_version2
Initial value:
= {
.number = 2,
.procs = nfs_procedures
}

Definition at line 1134 of file nfs2xdr.c.

Definition at line 1047 of file nfs2xdr.c.