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>
This commit is contained in:
J. Bruce Fields 2010-03-04 11:32:59 -05:00
parent b5a1a81e5c
commit b12a05cbdf
3 changed files with 2 additions and 17 deletions

View File

@ -681,10 +681,8 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata)
static void nfsd4_cb_recall_release(void *calldata) static void nfsd4_cb_recall_release(void *calldata)
{ {
struct nfs4_delegation *dp = calldata; struct nfs4_delegation *dp = calldata;
struct nfs4_client *clp = dp->dl_client;
nfs4_put_delegation(dp); nfs4_put_delegation(dp);
put_nfs4_client(clp);
} }
static const struct rpc_call_ops nfsd4_cb_recall_ops = { static const struct rpc_call_ops nfsd4_cb_recall_ops = {
@ -746,10 +744,8 @@ static void _nfsd4_cb_recall(struct nfs4_delegation *dp)
dp->dl_retries = 1; dp->dl_retries = 1;
status = rpc_call_async(clnt, &msg, RPC_TASK_SOFT, status = rpc_call_async(clnt, &msg, RPC_TASK_SOFT,
&nfsd4_cb_recall_ops, dp); &nfsd4_cb_recall_ops, dp);
if (status) { if (status)
put_nfs4_client(clp);
nfs4_put_delegation(dp); nfs4_put_delegation(dp);
}
} }
void nfsd4_do_callback_rpc(struct work_struct *w) void nfsd4_do_callback_rpc(struct work_struct *w)

View File

@ -690,13 +690,6 @@ free_client(struct nfs4_client *clp)
kfree(clp); kfree(clp);
} }
void
put_nfs4_client(struct nfs4_client *clp)
{
if (atomic_dec_and_test(&clp->cl_count))
free_client(clp);
}
static void static void
expire_client(struct nfs4_client *clp) expire_client(struct nfs4_client *clp)
{ {
@ -735,7 +728,7 @@ expire_client(struct nfs4_client *clp)
nfsd4_set_callback_client(clp, NULL); nfsd4_set_callback_client(clp, NULL);
if (clp->cl_cb_xprt) if (clp->cl_cb_xprt)
svc_xprt_put(clp->cl_cb_xprt); svc_xprt_put(clp->cl_cb_xprt);
put_nfs4_client(clp); free_client(clp);
} }
static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) 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,
} }
memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); memcpy(clp->cl_recdir, recdir, HEXDIR_LEN);
atomic_set(&clp->cl_count, 1);
atomic_set(&clp->cl_cb_conn.cb_set, 0); atomic_set(&clp->cl_cb_conn.cb_set, 0);
INIT_LIST_HEAD(&clp->cl_idhash); INIT_LIST_HEAD(&clp->cl_idhash);
INIT_LIST_HEAD(&clp->cl_strhash); INIT_LIST_HEAD(&clp->cl_strhash);
@ -2010,7 +2002,6 @@ void nfsd_break_deleg_cb(struct file_lock *fl)
* lock) we know the server hasn't removed the lease yet, we know * lock) we know the server hasn't removed the lease yet, we know
* it's safe to take a reference: */ * it's safe to take a reference: */
atomic_inc(&dp->dl_count); atomic_inc(&dp->dl_count);
atomic_inc(&dp->dl_client->cl_count);
spin_lock(&recall_lock); spin_lock(&recall_lock);
list_add_tail(&dp->dl_recall_lru, &del_recall_lru); list_add_tail(&dp->dl_recall_lru, &del_recall_lru);

View File

@ -224,7 +224,6 @@ struct nfs4_client {
clientid_t cl_clientid; /* generated by server */ clientid_t cl_clientid; /* generated by server */
nfs4_verifier cl_confirm; /* generated by server */ nfs4_verifier cl_confirm; /* generated by server */
struct nfs4_cb_conn cl_cb_conn; /* callback info */ struct nfs4_cb_conn cl_cb_conn; /* callback info */
atomic_t cl_count; /* ref count */
u32 cl_firststate; /* recovery dir creation */ u32 cl_firststate; /* recovery dir creation */
/* for nfs41 */ /* for nfs41 */
@ -388,7 +387,6 @@ extern void nfs4_lock_state(void);
extern void nfs4_unlock_state(void); extern void nfs4_unlock_state(void);
extern int nfs4_in_grace(void); extern int nfs4_in_grace(void);
extern __be32 nfs4_check_open_reclaim(clientid_t *clid); extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
extern void put_nfs4_client(struct nfs4_client *clp);
extern void nfs4_free_stateowner(struct kref *kref); extern void nfs4_free_stateowner(struct kref *kref);
extern int set_callback_cred(void); extern int set_callback_cred(void);
extern void nfsd4_probe_callback(struct nfs4_client *clp); extern void nfsd4_probe_callback(struct nfs4_client *clp);