diff options
author | Yu Zhiguo <yuzg@cn.fujitsu.com> | 2009-05-19 02:09:54 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-06-01 18:09:20 -0400 |
commit | 0a93a47f042c459f0f46942c3a920e3c81878031 (patch) | |
tree | 9204c71810c955114ce4e6f73bdbf70d6b0dcc59 /fs/nfsd | |
parent | 3c8e03166ae234d16e7871f8009638e0946d303c (diff) |
NFSv4: kill off complicated macro 'PROC'
J. Bruce Fields wrote:
...
> (This is extremely confusing code to track down: note that
> proc->pc_decode is set to nfs4svc_decode_compoundargs() by the PROC()
> macro at the end of fs/nfsd/nfs4proc.c. Which means, for example, that
> grepping for nfs4svc_decode_compoundargs() gets you nowhere. Patches to
> kill off that macro would be welcomed....)
the macro 'PROC' is complicated and obscure, it had better
be killed off in order to make the code more clear.
Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 9272e1f806fc..7c8801769a3c 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -1313,24 +1313,9 @@ static const char *nfsd4_op_name(unsigned opnum) | |||
1313 | return "unknown_operation"; | 1313 | return "unknown_operation"; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | #define nfs4svc_decode_voidargs NULL | ||
1317 | #define nfs4svc_release_void NULL | ||
1318 | #define nfsd4_voidres nfsd4_voidargs | 1316 | #define nfsd4_voidres nfsd4_voidargs |
1319 | #define nfs4svc_release_compound NULL | ||
1320 | struct nfsd4_voidargs { int dummy; }; | 1317 | struct nfsd4_voidargs { int dummy; }; |
1321 | 1318 | ||
1322 | #define PROC(name, argt, rest, relt, cache, respsize) \ | ||
1323 | { (svc_procfunc) nfsd4_proc_##name, \ | ||
1324 | (kxdrproc_t) nfs4svc_decode_##argt##args, \ | ||
1325 | (kxdrproc_t) nfs4svc_encode_##rest##res, \ | ||
1326 | (kxdrproc_t) nfs4svc_release_##relt, \ | ||
1327 | sizeof(struct nfsd4_##argt##args), \ | ||
1328 | sizeof(struct nfsd4_##rest##res), \ | ||
1329 | 0, \ | ||
1330 | cache, \ | ||
1331 | respsize, \ | ||
1332 | } | ||
1333 | |||
1334 | /* | 1319 | /* |
1335 | * TODO: At the present time, the NFSv4 server does not do XID caching | 1320 | * TODO: At the present time, the NFSv4 server does not do XID caching |
1336 | * of requests. Implementing XID caching would not be a serious problem, | 1321 | * of requests. Implementing XID caching would not be a serious problem, |
@@ -1342,8 +1327,23 @@ struct nfsd4_voidargs { int dummy; }; | |||
1342 | * better XID's. | 1327 | * better XID's. |
1343 | */ | 1328 | */ |
1344 | static struct svc_procedure nfsd_procedures4[2] = { | 1329 | static struct svc_procedure nfsd_procedures4[2] = { |
1345 | PROC(null, void, void, void, RC_NOCACHE, 1), | 1330 | [NFSPROC4_NULL] = { |
1346 | PROC(compound, compound, compound, compound, RC_NOCACHE, NFSD_BUFSIZE/4) | 1331 | .pc_func = (svc_procfunc) nfsd4_proc_null, |
1332 | .pc_encode = (kxdrproc_t) nfs4svc_encode_voidres, | ||
1333 | .pc_argsize = sizeof(struct nfsd4_voidargs), | ||
1334 | .pc_ressize = sizeof(struct nfsd4_voidres), | ||
1335 | .pc_cachetype = RC_NOCACHE, | ||
1336 | .pc_xdrressize = 1, | ||
1337 | }, | ||
1338 | [NFSPROC4_COMPOUND] = { | ||
1339 | .pc_func = (svc_procfunc) nfsd4_proc_compound, | ||
1340 | .pc_decode = (kxdrproc_t) nfs4svc_decode_compoundargs, | ||
1341 | .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, | ||
1342 | .pc_argsize = sizeof(struct nfsd4_compoundargs), | ||
1343 | .pc_ressize = sizeof(struct nfsd4_compoundres), | ||
1344 | .pc_cachetype = RC_NOCACHE, | ||
1345 | .pc_xdrressize = NFSD_BUFSIZE/4, | ||
1346 | }, | ||
1347 | }; | 1347 | }; |
1348 | 1348 | ||
1349 | struct svc_version nfsd_version4 = { | 1349 | struct svc_version nfsd_version4 = { |