diff options
author | Benny Halevy <bhalevy@panasas.com> | 2010-05-11 17:13:29 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2010-05-13 11:47:03 -0400 |
commit | 46583e2597af649f134462d2f2c1be5e6689198d (patch) | |
tree | 4d760a1f60db3f057f8f3ea1549a8422c9eff031 /fs/nfsd/nfs4state.c | |
parent | 84d38ac9abf0a5bc0044c9363acaad55a9a4be0d (diff) |
nfsd4: introduce nfs4_client.cl_refcount
Currently just initialize the cl_refcount to 1
and decrement in expire_client(), conditionally freeing the
client when the refcount reaches 0.
To be used later by nfsv4.1 compounds to keep the client from
timing out while in use.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index dede43c37336..e439a882e0c2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -740,8 +740,9 @@ expire_client(struct nfs4_client *clp) | |||
740 | list_del(&clp->cl_strhash); | 740 | list_del(&clp->cl_strhash); |
741 | spin_lock(&client_lock); | 741 | spin_lock(&client_lock); |
742 | unhash_client_locked(clp); | 742 | unhash_client_locked(clp); |
743 | if (atomic_read(&clp->cl_refcount) == 0) | ||
744 | free_client(clp); | ||
743 | spin_unlock(&client_lock); | 745 | spin_unlock(&client_lock); |
744 | free_client(clp); | ||
745 | } | 746 | } |
746 | 747 | ||
747 | static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) | 748 | static void copy_verf(struct nfs4_client *target, nfs4_verifier *source) |
@@ -827,6 +828,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, | |||
827 | } | 828 | } |
828 | 829 | ||
829 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); | 830 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); |
831 | atomic_set(&clp->cl_refcount, 0); | ||
830 | atomic_set(&clp->cl_cb_set, 0); | 832 | atomic_set(&clp->cl_cb_set, 0); |
831 | INIT_LIST_HEAD(&clp->cl_idhash); | 833 | INIT_LIST_HEAD(&clp->cl_idhash); |
832 | INIT_LIST_HEAD(&clp->cl_strhash); | 834 | INIT_LIST_HEAD(&clp->cl_strhash); |