aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
author\"J. Bruce Fields\ <bfields@citi.umich.edu>2008-12-23 16:10:19 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 16:10:19 -0500
commitcf81939d6fcdf381fcb069d780c29eceb516bccd (patch)
tree1f55847a9c540d0f5ab7f42c1bd84fdb7d0cb38a /net/sunrpc
parente712804ae4bd858bd89272aa3fc1a577294c0940 (diff)
rpc: track number of users of the gss upcall pipe
Keep a count of the number of pipes open plus the number of messages on a pipe. This count isn't used yet. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index bc512fff8a41..51aa27d32b5a 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -75,6 +75,8 @@ struct gss_auth {
75 struct dentry *dentry; 75 struct dentry *dentry;
76}; 76};
77 77
78static atomic_t pipe_users = ATOMIC_INIT(0);
79
78static void gss_free_ctx(struct gss_cl_ctx *); 80static void gss_free_ctx(struct gss_cl_ctx *);
79static struct rpc_pipe_ops gss_upcall_ops; 81static struct rpc_pipe_ops gss_upcall_ops;
80 82
@@ -237,6 +239,7 @@ gss_release_msg(struct gss_upcall_msg *gss_msg)
237{ 239{
238 if (!atomic_dec_and_test(&gss_msg->count)) 240 if (!atomic_dec_and_test(&gss_msg->count))
239 return; 241 return;
242 atomic_dec(&pipe_users);
240 BUG_ON(!list_empty(&gss_msg->list)); 243 BUG_ON(!list_empty(&gss_msg->list));
241 if (gss_msg->ctx != NULL) 244 if (gss_msg->ctx != NULL)
242 gss_put_ctx(gss_msg->ctx); 245 gss_put_ctx(gss_msg->ctx);
@@ -331,6 +334,7 @@ gss_alloc_msg(struct gss_auth *gss_auth, uid_t uid)
331 gss_msg = kzalloc(sizeof(*gss_msg), GFP_NOFS); 334 gss_msg = kzalloc(sizeof(*gss_msg), GFP_NOFS);
332 if (gss_msg == NULL) 335 if (gss_msg == NULL)
333 return ERR_PTR(-ENOMEM); 336 return ERR_PTR(-ENOMEM);
337 atomic_inc(&pipe_users);
334 INIT_LIST_HEAD(&gss_msg->list); 338 INIT_LIST_HEAD(&gss_msg->list);
335 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq"); 339 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq");
336 init_waitqueue_head(&gss_msg->waitqueue); 340 init_waitqueue_head(&gss_msg->waitqueue);
@@ -555,6 +559,13 @@ out:
555 return err; 559 return err;
556} 560}
557 561
562static int
563gss_pipe_open(struct inode *inode)
564{
565 atomic_inc(&pipe_users);
566 return 0;
567}
568
558static void 569static void
559gss_pipe_release(struct inode *inode) 570gss_pipe_release(struct inode *inode)
560{ 571{
@@ -574,6 +585,8 @@ gss_pipe_release(struct inode *inode)
574 spin_lock(&inode->i_lock); 585 spin_lock(&inode->i_lock);
575 } 586 }
576 spin_unlock(&inode->i_lock); 587 spin_unlock(&inode->i_lock);
588
589 atomic_dec(&pipe_users);
577} 590}
578 591
579static void 592static void
@@ -1349,6 +1362,7 @@ static struct rpc_pipe_ops gss_upcall_ops = {
1349 .upcall = gss_pipe_upcall, 1362 .upcall = gss_pipe_upcall,
1350 .downcall = gss_pipe_downcall, 1363 .downcall = gss_pipe_downcall,
1351 .destroy_msg = gss_pipe_destroy_msg, 1364 .destroy_msg = gss_pipe_destroy_msg,
1365 .open_pipe = gss_pipe_open,
1352 .release_pipe = gss_pipe_release, 1366 .release_pipe = gss_pipe_release,
1353}; 1367};
1354 1368