aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-27 14:29:04 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:37 -0400
commit1be27f36601973815171db684c711d30557cf50c (patch)
tree37119def0079958b1ec444ee6a3b2ec3b15337b5
parent1dd17ec693bf4a08b666c2ef76b68ca08ce3c93d (diff)
SUNRPC: Remove the tk_auth macro...
We should almost always be deferencing the rpc_auth struct by means of the credential's cr_auth field instead of the rpc_clnt->cl_auth anyway. Fix up that historical mistake, and remove the macro that propagated it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs2xdr.c6
-rw-r--r--fs/nfs/nfs3xdr.c8
-rw-r--r--fs/nfs/nfs4xdr.c10
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--net/sunrpc/auth.c25
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c4
-rw-r--r--net/sunrpc/auth_unix.c2
-rw-r--r--net/sunrpc/clnt.c2
8 files changed, 29 insertions, 29 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index cd3ca7b5d3db..7fcc78f2aa71 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -223,7 +223,7 @@ nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args)
223static int 223static int
224nfs_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) 224nfs_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
225{ 225{
226 struct rpc_auth *auth = req->rq_task->tk_auth; 226 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
227 unsigned int replen; 227 unsigned int replen;
228 u32 offset = (u32)args->offset; 228 u32 offset = (u32)args->offset;
229 u32 count = args->count; 229 u32 count = args->count;
@@ -380,7 +380,7 @@ static int
380nfs_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs_readdirargs *args) 380nfs_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs_readdirargs *args)
381{ 381{
382 struct rpc_task *task = req->rq_task; 382 struct rpc_task *task = req->rq_task;
383 struct rpc_auth *auth = task->tk_auth; 383 struct rpc_auth *auth = task->tk_msg.rpc_cred->cr_auth;
384 unsigned int replen; 384 unsigned int replen;
385 u32 count = args->count; 385 u32 count = args->count;
386 386
@@ -541,7 +541,7 @@ nfs_xdr_diropres(struct rpc_rqst *req, __be32 *p, struct nfs_diropok *res)
541static int 541static int
542nfs_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_readlinkargs *args) 542nfs_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_readlinkargs *args)
543{ 543{
544 struct rpc_auth *auth = req->rq_task->tk_auth; 544 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
545 unsigned int replen; 545 unsigned int replen;
546 546
547 p = xdr_encode_fhandle(p, args->fh); 547 p = xdr_encode_fhandle(p, args->fh);
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index b51df8eb9f01..b4647a22f349 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -319,7 +319,7 @@ nfs3_xdr_accessargs(struct rpc_rqst *req, __be32 *p, struct nfs3_accessargs *arg
319static int 319static int
320nfs3_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) 320nfs3_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
321{ 321{
322 struct rpc_auth *auth = req->rq_task->tk_auth; 322 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
323 unsigned int replen; 323 unsigned int replen;
324 u32 count = args->count; 324 u32 count = args->count;
325 325
@@ -458,7 +458,7 @@ nfs3_xdr_linkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_linkargs *args)
458static int 458static int
459nfs3_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirargs *args) 459nfs3_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirargs *args)
460{ 460{
461 struct rpc_auth *auth = req->rq_task->tk_auth; 461 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
462 unsigned int replen; 462 unsigned int replen;
463 u32 count = args->count; 463 u32 count = args->count;
464 464
@@ -643,7 +643,7 @@ static int
643nfs3_xdr_getaclargs(struct rpc_rqst *req, __be32 *p, 643nfs3_xdr_getaclargs(struct rpc_rqst *req, __be32 *p,
644 struct nfs3_getaclargs *args) 644 struct nfs3_getaclargs *args)
645{ 645{
646 struct rpc_auth *auth = req->rq_task->tk_auth; 646 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
647 unsigned int replen; 647 unsigned int replen;
648 648
649 p = xdr_encode_fhandle(p, args->fh); 649 p = xdr_encode_fhandle(p, args->fh);
@@ -773,7 +773,7 @@ nfs3_xdr_accessres(struct rpc_rqst *req, __be32 *p, struct nfs3_accessres *res)
773static int 773static int
774nfs3_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readlinkargs *args) 774nfs3_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readlinkargs *args)
775{ 775{
776 struct rpc_auth *auth = req->rq_task->tk_auth; 776 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
777 unsigned int replen; 777 unsigned int replen;
778 778
779 p = xdr_encode_fhandle(p, args->fh); 779 p = xdr_encode_fhandle(p, args->fh);
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 1fcca516e6ee..859b13633258 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1071,7 +1071,7 @@ static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
1071 1071
1072static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req) 1072static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req)
1073{ 1073{
1074 struct rpc_auth *auth = req->rq_task->tk_auth; 1074 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1075 uint32_t attrs[2] = { 1075 uint32_t attrs[2] = {
1076 FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, 1076 FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID,
1077 FATTR4_WORD1_MOUNTED_ON_FILEID, 1077 FATTR4_WORD1_MOUNTED_ON_FILEID,
@@ -1117,7 +1117,7 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1117 1117
1118static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req) 1118static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req)
1119{ 1119{
1120 struct rpc_auth *auth = req->rq_task->tk_auth; 1120 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1121 unsigned int replen; 1121 unsigned int replen;
1122 __be32 *p; 1122 __be32 *p;
1123 1123
@@ -1735,7 +1735,7 @@ out:
1735 */ 1735 */
1736static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) 1736static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args)
1737{ 1737{
1738 struct rpc_auth *auth = req->rq_task->tk_auth; 1738 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1739 struct xdr_stream xdr; 1739 struct xdr_stream xdr;
1740 struct compound_hdr hdr = { 1740 struct compound_hdr hdr = {
1741 .nops = 2, 1741 .nops = 2,
@@ -1795,7 +1795,7 @@ nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p,
1795 struct nfs_getaclargs *args) 1795 struct nfs_getaclargs *args)
1796{ 1796{
1797 struct xdr_stream xdr; 1797 struct xdr_stream xdr;
1798 struct rpc_auth *auth = req->rq_task->tk_auth; 1798 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
1799 struct compound_hdr hdr = { 1799 struct compound_hdr hdr = {
1800 .nops = 2, 1800 .nops = 2,
1801 }; 1801 };
@@ -2030,7 +2030,7 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs
2030 struct compound_hdr hdr = { 2030 struct compound_hdr hdr = {
2031 .nops = 3, 2031 .nops = 3,
2032 }; 2032 };
2033 struct rpc_auth *auth = req->rq_task->tk_auth; 2033 struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth;
2034 int replen; 2034 int replen;
2035 int status; 2035 int status;
2036 2036
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 3387b008cdfc..8ea077db0099 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -98,7 +98,6 @@ struct rpc_task {
98 unsigned short tk_pid; /* debugging aid */ 98 unsigned short tk_pid; /* debugging aid */
99#endif 99#endif
100}; 100};
101#define tk_auth tk_client->cl_auth
102#define tk_xprt tk_client->cl_xprt 101#define tk_xprt tk_client->cl_xprt
103 102
104/* support walking a list of tasks on a wait queue */ 103/* support walking a list of tasks on a wait queue */
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 81f4c776c558..74baf87ccff9 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -371,7 +371,7 @@ EXPORT_SYMBOL(rpcauth_init_cred);
371struct rpc_cred * 371struct rpc_cred *
372rpcauth_bindcred(struct rpc_task *task) 372rpcauth_bindcred(struct rpc_task *task)
373{ 373{
374 struct rpc_auth *auth = task->tk_auth; 374 struct rpc_auth *auth = task->tk_client->cl_auth;
375 struct auth_cred acred = { 375 struct auth_cred acred = {
376 .uid = current->fsuid, 376 .uid = current->fsuid,
377 .gid = current->fsgid, 377 .gid = current->fsgid,
@@ -381,7 +381,7 @@ rpcauth_bindcred(struct rpc_task *task)
381 int flags = 0; 381 int flags = 0;
382 382
383 dprintk("RPC: %5u looking up %s cred\n", 383 dprintk("RPC: %5u looking up %s cred\n",
384 task->tk_pid, task->tk_auth->au_ops->au_name); 384 task->tk_pid, task->tk_client->cl_auth->au_ops->au_name);
385 get_group_info(acred.group_info); 385 get_group_info(acred.group_info);
386 if (task->tk_flags & RPC_TASK_ROOTCREDS) 386 if (task->tk_flags & RPC_TASK_ROOTCREDS)
387 flags |= RPCAUTH_LOOKUP_ROOTCREDS; 387 flags |= RPCAUTH_LOOKUP_ROOTCREDS;
@@ -397,11 +397,12 @@ rpcauth_bindcred(struct rpc_task *task)
397void 397void
398rpcauth_holdcred(struct rpc_task *task) 398rpcauth_holdcred(struct rpc_task *task)
399{ 399{
400 dprintk("RPC: %5u holding %s cred %p\n", 400 struct rpc_cred *cred = task->tk_msg.rpc_cred;
401 task->tk_pid, task->tk_auth->au_ops->au_name, 401 if (cred != NULL) {
402 task->tk_msg.rpc_cred); 402 get_rpccred(cred);
403 if (task->tk_msg.rpc_cred) 403 dprintk("RPC: %5u holding %s cred %p\n", task->tk_pid,
404 get_rpccred(task->tk_msg.rpc_cred); 404 cred->cr_auth->au_ops->au_name, cred);
405 }
405} 406}
406 407
407void 408void
@@ -441,7 +442,7 @@ rpcauth_unbindcred(struct rpc_task *task)
441 struct rpc_cred *cred = task->tk_msg.rpc_cred; 442 struct rpc_cred *cred = task->tk_msg.rpc_cred;
442 443
443 dprintk("RPC: %5u releasing %s cred %p\n", 444 dprintk("RPC: %5u releasing %s cred %p\n",
444 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 445 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
445 446
446 put_rpccred(cred); 447 put_rpccred(cred);
447 task->tk_msg.rpc_cred = NULL; 448 task->tk_msg.rpc_cred = NULL;
@@ -453,7 +454,7 @@ rpcauth_marshcred(struct rpc_task *task, __be32 *p)
453 struct rpc_cred *cred = task->tk_msg.rpc_cred; 454 struct rpc_cred *cred = task->tk_msg.rpc_cred;
454 455
455 dprintk("RPC: %5u marshaling %s cred %p\n", 456 dprintk("RPC: %5u marshaling %s cred %p\n",
456 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 457 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
457 458
458 return cred->cr_ops->crmarshal(task, p); 459 return cred->cr_ops->crmarshal(task, p);
459} 460}
@@ -464,7 +465,7 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
464 struct rpc_cred *cred = task->tk_msg.rpc_cred; 465 struct rpc_cred *cred = task->tk_msg.rpc_cred;
465 466
466 dprintk("RPC: %5u validating %s cred %p\n", 467 dprintk("RPC: %5u validating %s cred %p\n",
467 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 468 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
468 469
469 return cred->cr_ops->crvalidate(task, p); 470 return cred->cr_ops->crvalidate(task, p);
470} 471}
@@ -505,7 +506,7 @@ rpcauth_refreshcred(struct rpc_task *task)
505 int err; 506 int err;
506 507
507 dprintk("RPC: %5u refreshing %s cred %p\n", 508 dprintk("RPC: %5u refreshing %s cred %p\n",
508 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 509 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
509 510
510 err = cred->cr_ops->crrefresh(task); 511 err = cred->cr_ops->crrefresh(task);
511 if (err < 0) 512 if (err < 0)
@@ -519,7 +520,7 @@ rpcauth_invalcred(struct rpc_task *task)
519 struct rpc_cred *cred = task->tk_msg.rpc_cred; 520 struct rpc_cred *cred = task->tk_msg.rpc_cred;
520 521
521 dprintk("RPC: %5u invalidating %s cred %p\n", 522 dprintk("RPC: %5u invalidating %s cred %p\n",
522 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 523 task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
523 if (cred) 524 if (cred)
524 clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); 525 clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
525} 526}
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 15da6f82db36..debcda86467c 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -906,7 +906,7 @@ gss_validate(struct rpc_task *task, __be32 *p)
906 goto out_bad; 906 goto out_bad;
907 /* We leave it to unwrap to calculate au_rslack. For now we just 907 /* We leave it to unwrap to calculate au_rslack. For now we just
908 * calculate the length of the verifier: */ 908 * calculate the length of the verifier: */
909 task->tk_auth->au_verfsize = XDR_QUADLEN(len) + 2; 909 cred->cr_auth->au_verfsize = XDR_QUADLEN(len) + 2;
910 gss_put_ctx(ctx); 910 gss_put_ctx(ctx);
911 dprintk("RPC: %5u gss_validate: gss_verify_mic succeeded.\n", 911 dprintk("RPC: %5u gss_validate: gss_verify_mic succeeded.\n",
912 task->tk_pid); 912 task->tk_pid);
@@ -1206,7 +1206,7 @@ gss_unwrap_resp(struct rpc_task *task,
1206 break; 1206 break;
1207 } 1207 }
1208 /* take into account extra slack for integrity and privacy cases: */ 1208 /* take into account extra slack for integrity and privacy cases: */
1209 task->tk_auth->au_rslack = task->tk_auth->au_verfsize + (p - savedp) 1209 cred->cr_auth->au_rslack = cred->cr_auth->au_verfsize + (p - savedp)
1210 + (savedlen - head->iov_len); 1210 + (savedlen - head->iov_len);
1211out_decode: 1211out_decode:
1212 status = decode(rqstp, p, obj); 1212 status = decode(rqstp, p, obj);
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index d9c50d810d15..5ed91e5bcee4 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -204,7 +204,7 @@ unx_validate(struct rpc_task *task, __be32 *p)
204 printk("RPC: giant verf size: %u\n", size); 204 printk("RPC: giant verf size: %u\n", size);
205 return NULL; 205 return NULL;
206 } 206 }
207 task->tk_auth->au_rslack = (size >> 2) + 2; 207 task->tk_msg.rpc_cred->cr_auth->au_rslack = (size >> 2) + 2;
208 p += (size >> 2); 208 p += (size >> 2);
209 209
210 return p; 210 return p;
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 28a789419f64..50af8bbe7f20 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -787,7 +787,7 @@ call_reserveresult(struct rpc_task *task)
787static void 787static void
788call_allocate(struct rpc_task *task) 788call_allocate(struct rpc_task *task)
789{ 789{
790 unsigned int slack = task->tk_auth->au_cslack; 790 unsigned int slack = task->tk_msg.rpc_cred->cr_auth->au_cslack;
791 struct rpc_rqst *req = task->tk_rqstp; 791 struct rpc_rqst *req = task->tk_rqstp;
792 struct rpc_xprt *xprt = task->tk_xprt; 792 struct rpc_xprt *xprt = task->tk_xprt;
793 struct rpc_procinfo *proc = task->tk_msg.rpc_proc; 793 struct rpc_procinfo *proc = task->tk_msg.rpc_proc;