diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2010-12-23 20:32:32 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-01-06 14:47:56 -0500 |
commit | fca5238ef3232cd0cf4bf0457e751b3bb20912a9 (patch) | |
tree | 5b61da0d71e3e89b835d46a49e0f4945b5002cea /fs/nfs/nfs4renewd.c | |
parent | f7e8917a67980924651a9e244510e63ef05c7755 (diff) |
NFS: Allow walking nfs_client.cl_superblocks list outside client.c
We're about to move some fields from struct nfs_client to struct
nfs_server. There is a many-to-one relationship between nfs_servers
and nfs_clients. After these fields are moved to the nfs_server
struct, to visit all of the data in these fields that is owned by one
nfs_client, code will need to visit each nfs_server on the
cl_superblocks list for that nfs_client.
To serialize changes to the cl_superblocks list during these little
expeditions, protect the list with RCU.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4renewd.c')
-rw-r--r-- | fs/nfs/nfs4renewd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/nfs4renewd.c b/fs/nfs/nfs4renewd.c index 72b6c580af13..cde5650ee5a2 100644 --- a/fs/nfs/nfs4renewd.c +++ b/fs/nfs/nfs4renewd.c | |||
@@ -63,9 +63,14 @@ nfs4_renew_state(struct work_struct *work) | |||
63 | 63 | ||
64 | ops = clp->cl_mvops->state_renewal_ops; | 64 | ops = clp->cl_mvops->state_renewal_ops; |
65 | dprintk("%s: start\n", __func__); | 65 | dprintk("%s: start\n", __func__); |
66 | /* Are there any active superblocks? */ | 66 | |
67 | if (list_empty(&clp->cl_superblocks)) | 67 | rcu_read_lock(); |
68 | if (list_empty(&clp->cl_superblocks)) { | ||
69 | rcu_read_unlock(); | ||
68 | goto out; | 70 | goto out; |
71 | } | ||
72 | rcu_read_unlock(); | ||
73 | |||
69 | spin_lock(&clp->cl_lock); | 74 | spin_lock(&clp->cl_lock); |
70 | lease = clp->cl_lease_time; | 75 | lease = clp->cl_lease_time; |
71 | last = clp->cl_last_renewal; | 76 | last = clp->cl_last_renewal; |