diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2010-03-04 11:32:59 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2010-04-22 11:34:02 -0400 |
commit | b12a05cbdfdf7e4d8cbe8fa78e995f971420086b (patch) | |
tree | 05f82bd2abf8ab0b688383c467b76db713cdcc09 /fs/nfsd | |
parent | b5a1a81e5c25fb6bb3fdc1812ba69ff6ab638fcf (diff) |
nfsd4: cl_count is unused
Now that the shutdown sequence guarantees callbacks are shut down before
the client is destroyed, we no longer have a use for cl_count.
We'll probably reinstate a reference count on the client some day, but
it will be held by users other than callbacks.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 6 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 11 | ||||
-rw-r--r-- | fs/nfsd/state.h | 2 |
3 files changed, 2 insertions, 17 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index e078c747f49d..5856fc8adb70 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -681,10 +681,8 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) | |||
681 | static void nfsd4_cb_recall_release(void *calldata) | 681 | static void nfsd4_cb_recall_release(void *calldata) |
682 | { | 682 | { |
683 | struct nfs4_delegation *dp = calldata; | 683 | struct nfs4_delegation *dp = calldata; |
684 | struct nfs4_client *clp = dp->dl_client; | ||
685 | 684 | ||
686 | nfs4_put_delegation(dp); | 685 | nfs4_put_delegation(dp); |
687 | put_nfs4_client(clp); | ||
688 | } | 686 | } |
689 | 687 | ||
690 | static const struct rpc_call_ops nfsd4_cb_recall_ops = { | 688 | static const struct rpc_call_ops nfsd4_cb_recall_ops = { |
@@ -746,10 +744,8 @@ static void _nfsd4_cb_recall(struct nfs4_delegation *dp) | |||
746 | dp->dl_retries = 1; | 744 | dp->dl_retries = 1; |
747 | status = rpc_call_async(clnt, &msg, RPC_TASK_SOFT, | 745 | status = rpc_call_async(clnt, &msg, RPC_TASK_SOFT, |
748 | &nfsd4_cb_recall_ops, dp); | 746 | &nfsd4_cb_recall_ops, dp); |
749 | if (status) { | 747 | if (status) |
750 | put_nfs4_client(clp); | ||
751 | nfs4_put_delegation(dp); | 748 | nfs4_put_delegation(dp); |
752 | } | ||
753 | } | 749 | } |
754 | 750 | ||
755 | void nfsd4_do_callback_rpc(struct work_struct *w) | 751 | void nfsd4_do_callback_rpc(struct work_struct *w) |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index adc51d10d435..cf650cbb814b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -690,13 +690,6 @@ free_client(struct nfs4_client *clp) | |||
690 | kfree(clp); | 690 | kfree(clp); |
691 | } | 691 | } |
692 | 692 | ||
693 | void | ||
694 | put_nfs4_client(struct nfs4_client *clp) | ||
695 | { | ||
696 | if (atomic_dec_and_test(&clp->cl_count)) | ||
697 | free_client(clp); | ||
698 | } | ||
699 | |||
700 | static void | 693 | static void |
701 | expire_client(struct nfs4_client *clp) | 694 | expire_client(struct nfs4_client *clp) |
702 | { | 695 | { |
@@ -735,7 +728,7 @@ expire_client(struct nfs4_client *clp) | |||
735 | nfsd4_set_callback_client(clp, NULL); | 728 | nfsd4_set_callback_client(clp, NULL); |
736 | if (clp->cl_cb_xprt) | 729 | if (clp->cl_cb_xprt) |
737 | svc_xprt_put(clp->cl_cb_xprt); | 730 | svc_xprt_put(clp->cl_cb_xprt); |
738 | put_nfs4_client(clp); | 731 | free_client(clp); |
739 | } | 732 | } |
740 | 733 | ||
741 | static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) | 734 | static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) |
@@ -821,7 +814,6 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, | |||
821 | } | 814 | } |
822 | 815 | ||
823 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); | 816 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); |
824 | atomic_set(&clp->cl_count, 1); | ||
825 | atomic_set(&clp->cl_cb_conn.cb_set, 0); | 817 | atomic_set(&clp->cl_cb_conn.cb_set, 0); |
826 | INIT_LIST_HEAD(&clp->cl_idhash); | 818 | INIT_LIST_HEAD(&clp->cl_idhash); |
827 | INIT_LIST_HEAD(&clp->cl_strhash); | 819 | INIT_LIST_HEAD(&clp->cl_strhash); |
@@ -2010,7 +2002,6 @@ void nfsd_break_deleg_cb(struct file_lock *fl) | |||
2010 | * lock) we know the server hasn't removed the lease yet, we know | 2002 | * lock) we know the server hasn't removed the lease yet, we know |
2011 | * it's safe to take a reference: */ | 2003 | * it's safe to take a reference: */ |
2012 | atomic_inc(&dp->dl_count); | 2004 | atomic_inc(&dp->dl_count); |
2013 | atomic_inc(&dp->dl_client->cl_count); | ||
2014 | 2005 | ||
2015 | spin_lock(&recall_lock); | 2006 | spin_lock(&recall_lock); |
2016 | list_add_tail(&dp->dl_recall_lru, &del_recall_lru); | 2007 | list_add_tail(&dp->dl_recall_lru, &del_recall_lru); |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index c4c92aea8f39..cef20abf330c 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -224,7 +224,6 @@ struct nfs4_client { | |||
224 | clientid_t cl_clientid; /* generated by server */ | 224 | clientid_t cl_clientid; /* generated by server */ |
225 | nfs4_verifier cl_confirm; /* generated by server */ | 225 | nfs4_verifier cl_confirm; /* generated by server */ |
226 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ | 226 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ |
227 | atomic_t cl_count; /* ref count */ | ||
228 | u32 cl_firststate; /* recovery dir creation */ | 227 | u32 cl_firststate; /* recovery dir creation */ |
229 | 228 | ||
230 | /* for nfs41 */ | 229 | /* for nfs41 */ |
@@ -388,7 +387,6 @@ extern void nfs4_lock_state(void); | |||
388 | extern void nfs4_unlock_state(void); | 387 | extern void nfs4_unlock_state(void); |
389 | extern int nfs4_in_grace(void); | 388 | extern int nfs4_in_grace(void); |
390 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | 389 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
391 | extern void put_nfs4_client(struct nfs4_client *clp); | ||
392 | extern void nfs4_free_stateowner(struct kref *kref); | 390 | extern void nfs4_free_stateowner(struct kref *kref); |
393 | extern int set_callback_cred(void); | 391 | extern int set_callback_cred(void); |
394 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 392 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |