aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc_xprt.c
diff options
context:
space:
mode:
authorTom Tucker <tom@opengridcomputing.com>2007-12-30 22:08:08 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-02-01 16:42:12 -0500
commitdef13d7401e9b95bbd34c20057ebeb2972708b1b (patch)
treeafea72afdfe80c645eaf75aa828a49a6e1dec864 /net/sunrpc/svc_xprt.c
parent4bc6c497b26a7984cac842a09e2e8f8c46242782 (diff)
svc: Move the authinfo cache to svc_xprt.
Move the authinfo cache to svc_xprt. This allows both the TCP and RDMA transports to share this logic. A flag bit is used to determine if auth information is to be cached or not. Previously, this code looked at the transport protocol. I've also changed the spin_lock/unlock logic so that a lock is not taken for transports that are not caching auth info. Signed-off-by: Tom Tucker <tom@opengridcomputing.com> Acked-by: Neil Brown <neilb@suse.de> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Greg Banks <gnb@sgi.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r--net/sunrpc/svc_xprt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 3e6a1c81d4ce..d2ac130b9040 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -75,6 +75,9 @@ static void svc_xprt_free(struct kref *kref)
75 struct svc_xprt *xprt = 75 struct svc_xprt *xprt =
76 container_of(kref, struct svc_xprt, xpt_ref); 76 container_of(kref, struct svc_xprt, xpt_ref);
77 struct module *owner = xprt->xpt_class->xcl_owner; 77 struct module *owner = xprt->xpt_class->xcl_owner;
78 if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags)
79 && xprt->xpt_auth_cache != NULL)
80 svcauth_unix_info_release(xprt->xpt_auth_cache);
78 xprt->xpt_ops->xpo_free(xprt); 81 xprt->xpt_ops->xpo_free(xprt);
79 module_put(owner); 82 module_put(owner);
80} 83}
@@ -100,6 +103,7 @@ void svc_xprt_init(struct svc_xprt_class *xcl, struct svc_xprt *xprt,
100 INIT_LIST_HEAD(&xprt->xpt_list); 103 INIT_LIST_HEAD(&xprt->xpt_list);
101 INIT_LIST_HEAD(&xprt->xpt_ready); 104 INIT_LIST_HEAD(&xprt->xpt_ready);
102 mutex_init(&xprt->xpt_mutex); 105 mutex_init(&xprt->xpt_mutex);
106 spin_lock_init(&xprt->xpt_lock);
103} 107}
104EXPORT_SYMBOL_GPL(svc_xprt_init); 108EXPORT_SYMBOL_GPL(svc_xprt_init);
105 109