diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-07-31 14:29:08 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-08-04 08:54:09 -0400 |
commit | a17c2153d2e271b0cbacae9bed83b0eaa41db7e1 (patch) | |
tree | 3c5a73090987278e51aee1a9f185ebe40a00bd65 /net/sunrpc/auth_gss | |
parent | 8572b8e2e3c5f3d990122348c4d2c64dad338611 (diff) |
SUNRPC: Move the bound cred to struct rpc_rqst
This will allow us to save the original generic cred in rpc_message, so
that if we migrate from one server to another, we can generate a new bound
cred without having to punt back to the NFS layer.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 8da2a0e68574..096e1260bc67 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -373,7 +373,7 @@ gss_handle_downcall_result(struct gss_cred *gss_cred, struct gss_upcall_msg *gss | |||
373 | static void | 373 | static void |
374 | gss_upcall_callback(struct rpc_task *task) | 374 | gss_upcall_callback(struct rpc_task *task) |
375 | { | 375 | { |
376 | struct gss_cred *gss_cred = container_of(task->tk_msg.rpc_cred, | 376 | struct gss_cred *gss_cred = container_of(task->tk_rqstp->rq_cred, |
377 | struct gss_cred, gc_base); | 377 | struct gss_cred, gc_base); |
378 | struct gss_upcall_msg *gss_msg = gss_cred->gc_upcall; | 378 | struct gss_upcall_msg *gss_msg = gss_cred->gc_upcall; |
379 | struct inode *inode = &gss_msg->inode->vfs_inode; | 379 | struct inode *inode = &gss_msg->inode->vfs_inode; |
@@ -502,7 +502,7 @@ static void warn_gssd(void) | |||
502 | static inline int | 502 | static inline int |
503 | gss_refresh_upcall(struct rpc_task *task) | 503 | gss_refresh_upcall(struct rpc_task *task) |
504 | { | 504 | { |
505 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 505 | struct rpc_cred *cred = task->tk_rqstp->rq_cred; |
506 | struct gss_auth *gss_auth = container_of(cred->cr_auth, | 506 | struct gss_auth *gss_auth = container_of(cred->cr_auth, |
507 | struct gss_auth, rpc_auth); | 507 | struct gss_auth, rpc_auth); |
508 | struct gss_cred *gss_cred = container_of(cred, | 508 | struct gss_cred *gss_cred = container_of(cred, |
@@ -1064,12 +1064,12 @@ out: | |||
1064 | static __be32 * | 1064 | static __be32 * |
1065 | gss_marshal(struct rpc_task *task, __be32 *p) | 1065 | gss_marshal(struct rpc_task *task, __be32 *p) |
1066 | { | 1066 | { |
1067 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1067 | struct rpc_rqst *req = task->tk_rqstp; |
1068 | struct rpc_cred *cred = req->rq_cred; | ||
1068 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, | 1069 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, |
1069 | gc_base); | 1070 | gc_base); |
1070 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 1071 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |
1071 | __be32 *cred_len; | 1072 | __be32 *cred_len; |
1072 | struct rpc_rqst *req = task->tk_rqstp; | ||
1073 | u32 maj_stat = 0; | 1073 | u32 maj_stat = 0; |
1074 | struct xdr_netobj mic; | 1074 | struct xdr_netobj mic; |
1075 | struct kvec iov; | 1075 | struct kvec iov; |
@@ -1119,7 +1119,7 @@ out_put_ctx: | |||
1119 | 1119 | ||
1120 | static int gss_renew_cred(struct rpc_task *task) | 1120 | static int gss_renew_cred(struct rpc_task *task) |
1121 | { | 1121 | { |
1122 | struct rpc_cred *oldcred = task->tk_msg.rpc_cred; | 1122 | struct rpc_cred *oldcred = task->tk_rqstp->rq_cred; |
1123 | struct gss_cred *gss_cred = container_of(oldcred, | 1123 | struct gss_cred *gss_cred = container_of(oldcred, |
1124 | struct gss_cred, | 1124 | struct gss_cred, |
1125 | gc_base); | 1125 | gc_base); |
@@ -1133,7 +1133,7 @@ static int gss_renew_cred(struct rpc_task *task) | |||
1133 | new = gss_lookup_cred(auth, &acred, RPCAUTH_LOOKUP_NEW); | 1133 | new = gss_lookup_cred(auth, &acred, RPCAUTH_LOOKUP_NEW); |
1134 | if (IS_ERR(new)) | 1134 | if (IS_ERR(new)) |
1135 | return PTR_ERR(new); | 1135 | return PTR_ERR(new); |
1136 | task->tk_msg.rpc_cred = new; | 1136 | task->tk_rqstp->rq_cred = new; |
1137 | put_rpccred(oldcred); | 1137 | put_rpccred(oldcred); |
1138 | return 0; | 1138 | return 0; |
1139 | } | 1139 | } |
@@ -1161,7 +1161,7 @@ static int gss_cred_is_negative_entry(struct rpc_cred *cred) | |||
1161 | static int | 1161 | static int |
1162 | gss_refresh(struct rpc_task *task) | 1162 | gss_refresh(struct rpc_task *task) |
1163 | { | 1163 | { |
1164 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1164 | struct rpc_cred *cred = task->tk_rqstp->rq_cred; |
1165 | int ret = 0; | 1165 | int ret = 0; |
1166 | 1166 | ||
1167 | if (gss_cred_is_negative_entry(cred)) | 1167 | if (gss_cred_is_negative_entry(cred)) |
@@ -1172,7 +1172,7 @@ gss_refresh(struct rpc_task *task) | |||
1172 | ret = gss_renew_cred(task); | 1172 | ret = gss_renew_cred(task); |
1173 | if (ret < 0) | 1173 | if (ret < 0) |
1174 | goto out; | 1174 | goto out; |
1175 | cred = task->tk_msg.rpc_cred; | 1175 | cred = task->tk_rqstp->rq_cred; |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | if (test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) | 1178 | if (test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) |
@@ -1191,7 +1191,7 @@ gss_refresh_null(struct rpc_task *task) | |||
1191 | static __be32 * | 1191 | static __be32 * |
1192 | gss_validate(struct rpc_task *task, __be32 *p) | 1192 | gss_validate(struct rpc_task *task, __be32 *p) |
1193 | { | 1193 | { |
1194 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1194 | struct rpc_cred *cred = task->tk_rqstp->rq_cred; |
1195 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 1195 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |
1196 | __be32 seq; | 1196 | __be32 seq; |
1197 | struct kvec iov; | 1197 | struct kvec iov; |
@@ -1400,7 +1400,7 @@ static int | |||
1400 | gss_wrap_req(struct rpc_task *task, | 1400 | gss_wrap_req(struct rpc_task *task, |
1401 | kxdrproc_t encode, void *rqstp, __be32 *p, void *obj) | 1401 | kxdrproc_t encode, void *rqstp, __be32 *p, void *obj) |
1402 | { | 1402 | { |
1403 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1403 | struct rpc_cred *cred = task->tk_rqstp->rq_cred; |
1404 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, | 1404 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, |
1405 | gc_base); | 1405 | gc_base); |
1406 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 1406 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |
@@ -1503,7 +1503,7 @@ static int | |||
1503 | gss_unwrap_resp(struct rpc_task *task, | 1503 | gss_unwrap_resp(struct rpc_task *task, |
1504 | kxdrproc_t decode, void *rqstp, __be32 *p, void *obj) | 1504 | kxdrproc_t decode, void *rqstp, __be32 *p, void *obj) |
1505 | { | 1505 | { |
1506 | struct rpc_cred *cred = task->tk_msg.rpc_cred; | 1506 | struct rpc_cred *cred = task->tk_rqstp->rq_cred; |
1507 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, | 1507 | struct gss_cred *gss_cred = container_of(cred, struct gss_cred, |
1508 | gc_base); | 1508 | gc_base); |
1509 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); | 1509 | struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); |