From 83107cd7f181f40b0314937238eb633b59061466 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 4 Jan 2005 05:48:20 -0800 Subject: [PATCH] knfsd: count the nfs4_client structure usage ... to protect the null (probe) callback asynchronous rpc's reference. Atomically inc and set the cb_set flag. Signed-off-by: Andy Adamson Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/nfsd/state.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index c20635cc99a3..7491650f60c7 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h @@ -76,7 +76,7 @@ struct nfs4_callback { u32 cb_prog; u32 cb_ident; /* RPC client info */ - u32 cb_set; /* successful CB_NULL call */ + atomic_t cb_set; /* successful CB_NULL call */ struct rpc_program cb_program; struct rpc_stat cb_stat; struct rpc_clnt * cb_client; @@ -106,6 +106,7 @@ struct nfs4_client { nfs4_verifier cl_confirm; /* generated by server */ struct nfs4_callback cl_callback; /* callback info */ time_t cl_first_state; /* first state aquisition*/ + atomic_t cl_count; /* ref count */ }; /* struct nfs4_client_reset @@ -250,6 +251,7 @@ extern void nfs4_lock_state(void); extern void nfs4_unlock_state(void); extern int nfs4_in_grace(void); extern int nfs4_check_open_reclaim(clientid_t *clid); +extern void put_nfs4_client(struct nfs4_client *clp); extern void nfs4_free_stateowner(struct kref *kref); static inline void -- cgit v1.2.3