diff options
Diffstat (limited to 'net/sunrpc/auth_unix.c')
| -rw-r--r-- | net/sunrpc/auth_unix.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 46b2647c5bd2..4cb70dc6e7ad 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> | 6 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/slab.h> | ||
| 9 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 11 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| @@ -28,7 +29,6 @@ struct unx_cred { | |||
| 28 | #endif | 29 | #endif |
| 29 | 30 | ||
| 30 | static struct rpc_auth unix_auth; | 31 | static struct rpc_auth unix_auth; |
| 31 | static struct rpc_cred_cache unix_cred_cache; | ||
| 32 | static const struct rpc_credops unix_credops; | 32 | static const struct rpc_credops unix_credops; |
| 33 | 33 | ||
| 34 | static struct rpc_auth * | 34 | static struct rpc_auth * |
| @@ -140,7 +140,7 @@ static __be32 * | |||
| 140 | unx_marshal(struct rpc_task *task, __be32 *p) | 140 | unx_marshal(struct rpc_task *task, __be32 *p) |
| 141 | { | 141 | { |
| 142 | struct rpc_clnt *clnt = task->tk_client; | 142 | struct rpc_clnt *clnt = task->tk_client; |
| 143 | struct unx_cred *cred = container_of(task->tk_msg.rpc_cred, struct unx_cred, uc_base); | 143 | struct unx_cred *cred = container_of(task->tk_rqstp->rq_cred, struct unx_cred, uc_base); |
| 144 | __be32 *base, *hold; | 144 | __be32 *base, *hold; |
| 145 | int i; | 145 | int i; |
| 146 | 146 | ||
| @@ -173,7 +173,7 @@ unx_marshal(struct rpc_task *task, __be32 *p) | |||
| 173 | static int | 173 | static int |
| 174 | unx_refresh(struct rpc_task *task) | 174 | unx_refresh(struct rpc_task *task) |
| 175 | { | 175 | { |
| 176 | set_bit(RPCAUTH_CRED_UPTODATE, &task->tk_msg.rpc_cred->cr_flags); | 176 | set_bit(RPCAUTH_CRED_UPTODATE, &task->tk_rqstp->rq_cred->cr_flags); |
| 177 | return 0; | 177 | return 0; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| @@ -196,15 +196,20 @@ unx_validate(struct rpc_task *task, __be32 *p) | |||
| 196 | printk("RPC: giant verf size: %u\n", size); | 196 | printk("RPC: giant verf size: %u\n", size); |
| 197 | return NULL; | 197 | return NULL; |
| 198 | } | 198 | } |
| 199 | task->tk_msg.rpc_cred->cr_auth->au_rslack = (size >> 2) + 2; | 199 | task->tk_rqstp->rq_cred->cr_auth->au_rslack = (size >> 2) + 2; |
| 200 | p += (size >> 2); | 200 | p += (size >> 2); |
| 201 | 201 | ||
| 202 | return p; | 202 | return p; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | void __init rpc_init_authunix(void) | 205 | int __init rpc_init_authunix(void) |
| 206 | { | 206 | { |
| 207 | spin_lock_init(&unix_cred_cache.lock); | 207 | return rpcauth_init_credcache(&unix_auth); |
| 208 | } | ||
| 209 | |||
| 210 | void rpc_destroy_authunix(void) | ||
| 211 | { | ||
| 212 | rpcauth_destroy_credcache(&unix_auth); | ||
| 208 | } | 213 | } |
| 209 | 214 | ||
| 210 | const struct rpc_authops authunix_ops = { | 215 | const struct rpc_authops authunix_ops = { |
| @@ -218,17 +223,12 @@ const struct rpc_authops authunix_ops = { | |||
| 218 | }; | 223 | }; |
| 219 | 224 | ||
| 220 | static | 225 | static |
| 221 | struct rpc_cred_cache unix_cred_cache = { | ||
| 222 | }; | ||
| 223 | |||
| 224 | static | ||
| 225 | struct rpc_auth unix_auth = { | 226 | struct rpc_auth unix_auth = { |
| 226 | .au_cslack = UNX_WRITESLACK, | 227 | .au_cslack = UNX_WRITESLACK, |
| 227 | .au_rslack = 2, /* assume AUTH_NULL verf */ | 228 | .au_rslack = 2, /* assume AUTH_NULL verf */ |
| 228 | .au_ops = &authunix_ops, | 229 | .au_ops = &authunix_ops, |
| 229 | .au_flavor = RPC_AUTH_UNIX, | 230 | .au_flavor = RPC_AUTH_UNIX, |
| 230 | .au_count = ATOMIC_INIT(0), | 231 | .au_count = ATOMIC_INIT(0), |
| 231 | .au_credcache = &unix_cred_cache, | ||
| 232 | }; | 232 | }; |
| 233 | 233 | ||
| 234 | static | 234 | static |
