Commit 976c3111 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] PATCH 1 of 4 : knfsd : Use symbols for size calculation for response sizes.

Use symbolic names for some common size components in the response
size calculation for the NFSD.  This makes it easier to get the
numbers right and to review them.
This patch also fixes a few number for nfsv3 that were wrong.
parent 90ffa646
...@@ -658,27 +658,34 @@ struct nfsd3_voidargs { int dummy; }; ...@@ -658,27 +658,34 @@ struct nfsd3_voidargs { int dummy; };
cache, \ cache, \
respsize, \ respsize, \
} }
#define ST 1 /* status*/
#define FH 17 /* filehandle with length */
#define AT 21 /* attributes */
#define pAT (1+AT) /* post attributes - conditional */
#define WC (7+pAT) /* WCC attributes */
struct svc_procedure nfsd_procedures3[22] = { struct svc_procedure nfsd_procedures3[22] = {
PROC(null, void, void, void, RC_NOCACHE, 1), PROC(null, void, void, void, RC_NOCACHE, ST),
PROC(getattr, fhandle, attrstat, fhandle, RC_NOCACHE, 1+21), PROC(getattr, fhandle, attrstat, fhandle, RC_NOCACHE, ST+AT),
PROC(setattr, sattr, wccstat, fhandle, RC_REPLBUFF, 1+7+22), PROC(setattr, sattr, wccstat, fhandle, RC_REPLBUFF, ST+WC),
PROC(lookup, dirop, dirop, fhandle2, RC_NOCACHE, 1+9+22+22), PROC(lookup, dirop, dirop, fhandle2, RC_NOCACHE, ST+FH+pAT+pAT),
PROC(access, access, access, fhandle, RC_NOCACHE, 1+22+1), PROC(access, access, access, fhandle, RC_NOCACHE, ST+pAT+1),
PROC(readlink, fhandle, readlink, fhandle, RC_NOCACHE, 1+22+1+256), PROC(readlink, fhandle, readlink, fhandle, RC_NOCACHE, ST+pAT+1+256),
PROC(read, read, read, fhandle, RC_NOCACHE, 1+22+4+NFSSVC_MAXBLKSIZE), PROC(read, read, read, fhandle, RC_NOCACHE, ST+pAT+4+NFSSVC_MAXBLKSIZE),
PROC(write, write, write, fhandle, RC_REPLBUFF, 1+7+22+4), PROC(write, write, write, fhandle, RC_REPLBUFF, ST+WC+4),
PROC(create, create, create, fhandle2, RC_REPLBUFF, 1+(1+9+22)+7+22), PROC(create, create, create, fhandle2, RC_REPLBUFF, ST+(1+FH+pAT)+WC),
PROC(mkdir, mkdir, create, fhandle2, RC_REPLBUFF, 1+(1+9+22)+7+22), PROC(mkdir, mkdir, create, fhandle2, RC_REPLBUFF, ST+(1+FH+pAT)+WC),
PROC(symlink, symlink, create, fhandle2, RC_REPLBUFF, 1+(1+9+22)+7+22), PROC(symlink, symlink, create, fhandle2, RC_REPLBUFF, ST+(1+FH+pAT)+WC),
PROC(mknod, mknod, create, fhandle2, RC_REPLBUFF, 1+(1+9+22)+7+22), PROC(mknod, mknod, create, fhandle2, RC_REPLBUFF, ST+(1+FH+pAT)+WC),
PROC(remove, dirop, wccstat, fhandle, RC_REPLBUFF, 1+7+22), PROC(remove, dirop, wccstat, fhandle, RC_REPLBUFF, ST+WC),
PROC(rmdir, dirop, wccstat, fhandle, RC_REPLBUFF, 1+7+22), PROC(rmdir, dirop, wccstat, fhandle, RC_REPLBUFF, ST+WC),
PROC(rename, rename, rename, fhandle2, RC_REPLBUFF, 1+7+22+7+22), PROC(rename, rename, rename, fhandle2, RC_REPLBUFF, ST+WC+WC),
PROC(link, link, link, fhandle2, RC_REPLBUFF, 1+22+7+22), PROC(link, link, link, fhandle2, RC_REPLBUFF, ST+pAT+WC),
PROC(readdir, readdir, readdir, fhandle, RC_NOCACHE, 0), PROC(readdir, readdir, readdir, fhandle, RC_NOCACHE, 0),
PROC(readdirplus,readdirplus, readdir, fhandle, RC_NOCACHE, 0), PROC(readdirplus,readdirplus, readdir, fhandle, RC_NOCACHE, 0),
PROC(fsstat, fhandle, fsstat, void, RC_NOCACHE, 1+14), PROC(fsstat, fhandle, fsstat, void, RC_NOCACHE, ST+pAT+2*6+1),
PROC(fsinfo, fhandle, fsinfo, void, RC_NOCACHE, 1+13), PROC(fsinfo, fhandle, fsinfo, void, RC_NOCACHE, ST+pAT+12),
PROC(pathconf, fhandle, pathconf, void, RC_NOCACHE, 1+6), PROC(pathconf, fhandle, pathconf, void, RC_NOCACHE, ST+pAT+6),
PROC(commit, commit, commit, fhandle, RC_NOCACHE, 1+7+22+2), PROC(commit, commit, commit, fhandle, RC_NOCACHE, ST+WC+2),
}; };
...@@ -534,25 +534,30 @@ struct nfsd_void { int dummy; }; ...@@ -534,25 +534,30 @@ struct nfsd_void { int dummy; };
cache, \ cache, \
respsize, \ respsize, \
} }
#define ST 1 /* status */
#define FH 8 /* filehandle */
#define AT 18 /* attributes */
struct svc_procedure nfsd_procedures2[18] = { struct svc_procedure nfsd_procedures2[18] = {
PROC(null, void, void, none, RC_NOCACHE, 1), PROC(null, void, void, none, RC_NOCACHE, ST),
PROC(getattr, fhandle, attrstat, fhandle, RC_NOCACHE, 1+18), PROC(getattr, fhandle, attrstat, fhandle, RC_NOCACHE, ST+AT),
PROC(setattr, sattrargs, attrstat, fhandle, RC_REPLBUFF, 1+18), PROC(setattr, sattrargs, attrstat, fhandle, RC_REPLBUFF, ST+AT),
PROC(none, void, void, none, RC_NOCACHE, 1), PROC(none, void, void, none, RC_NOCACHE, ST),
PROC(lookup, diropargs, diropres, fhandle, RC_NOCACHE, 1+8+18), PROC(lookup, diropargs, diropres, fhandle, RC_NOCACHE, ST+FH+AT),
PROC(readlink, fhandle, readlinkres, none, RC_NOCACHE, 1+1+256), PROC(readlink, fhandle, readlinkres, none, RC_NOCACHE, ST+1+256),
PROC(read, readargs, readres, fhandle, RC_NOCACHE, 1+18+1+NFSSVC_MAXBLKSIZE), PROC(read, readargs, readres, fhandle, RC_NOCACHE, ST+AT+1+NFSSVC_MAXBLKSIZE),
PROC(none, void, void, none, RC_NOCACHE, 1), PROC(none, void, void, none, RC_NOCACHE, ST),
PROC(write, writeargs, attrstat, fhandle, RC_REPLBUFF, 1+18), PROC(write, writeargs, attrstat, fhandle, RC_REPLBUFF, ST+AT),
PROC(create, createargs, diropres, fhandle, RC_REPLBUFF, 1+8+18), PROC(create, createargs, diropres, fhandle, RC_REPLBUFF, ST+FH+AT),
PROC(remove, diropargs, void, none, RC_REPLSTAT, 1), PROC(remove, diropargs, void, none, RC_REPLSTAT, ST),
PROC(rename, renameargs, void, none, RC_REPLSTAT, 1), PROC(rename, renameargs, void, none, RC_REPLSTAT, ST),
PROC(link, linkargs, void, none, RC_REPLSTAT, 1), PROC(link, linkargs, void, none, RC_REPLSTAT, ST),
PROC(symlink, symlinkargs, void, none, RC_REPLSTAT, 1), PROC(symlink, symlinkargs, void, none, RC_REPLSTAT, ST),
PROC(mkdir, createargs, diropres, fhandle, RC_REPLBUFF, 1+8+18), PROC(mkdir, createargs, diropres, fhandle, RC_REPLBUFF, ST+FH+AT),
PROC(rmdir, diropargs, void, none, RC_REPLSTAT, 1), PROC(rmdir, diropargs, void, none, RC_REPLSTAT, ST),
PROC(readdir, readdirargs, readdirres, none, RC_REPLBUFF, 0), PROC(readdir, readdirargs, readdirres, none, RC_REPLBUFF, 0),
PROC(statfs, fhandle, statfsres, none, RC_NOCACHE, 1+5), PROC(statfs, fhandle, statfsres, none, RC_NOCACHE, ST+5),
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment