Skip to content

Commit e1943f4

Browse files
Mike SnitzerAnna Schumaker
authored andcommitted
nfs_common: rename nfslocalio nfs_uuid_lock to nfs_uuids_lock
This global spinlock protects all nfs_uuid_t relative to the global nfs_uuids list. A later commit will split this global spinlock so prepare by renaming this lock to reflect its intended narrow scope. Signed-off-by: Mike Snitzer <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent f9c3e1b commit e1943f4

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

fs/nfs_common/nfslocalio.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
MODULE_LICENSE("GPL");
1616
MODULE_DESCRIPTION("NFS localio protocol bypass support");
1717

18-
static DEFINE_SPINLOCK(nfs_uuid_lock);
18+
static DEFINE_SPINLOCK(nfs_uuids_lock);
1919

2020
/*
2121
* Global list of nfs_uuid_t instances
22-
* that is protected by nfs_uuid_lock.
22+
* that is protected by nfs_uuids_lock.
2323
*/
2424
static LIST_HEAD(nfs_uuids);
2525

@@ -34,15 +34,15 @@ EXPORT_SYMBOL_GPL(nfs_uuid_init);
3434

3535
bool nfs_uuid_begin(nfs_uuid_t *nfs_uuid)
3636
{
37-
spin_lock(&nfs_uuid_lock);
37+
spin_lock(&nfs_uuids_lock);
3838
/* Is this nfs_uuid already in use? */
3939
if (!list_empty(&nfs_uuid->list)) {
40-
spin_unlock(&nfs_uuid_lock);
40+
spin_unlock(&nfs_uuids_lock);
4141
return false;
4242
}
4343
uuid_gen(&nfs_uuid->uuid);
4444
list_add_tail(&nfs_uuid->list, &nfs_uuids);
45-
spin_unlock(&nfs_uuid_lock);
45+
spin_unlock(&nfs_uuids_lock);
4646

4747
return true;
4848
}
@@ -51,10 +51,10 @@ EXPORT_SYMBOL_GPL(nfs_uuid_begin);
5151
void nfs_uuid_end(nfs_uuid_t *nfs_uuid)
5252
{
5353
if (nfs_uuid->net == NULL) {
54-
spin_lock(&nfs_uuid_lock);
54+
spin_lock(&nfs_uuids_lock);
5555
if (nfs_uuid->net == NULL)
5656
list_del_init(&nfs_uuid->list);
57-
spin_unlock(&nfs_uuid_lock);
57+
spin_unlock(&nfs_uuids_lock);
5858
}
5959
}
6060
EXPORT_SYMBOL_GPL(nfs_uuid_end);
@@ -78,7 +78,7 @@ void nfs_uuid_is_local(const uuid_t *uuid, struct list_head *list,
7878
{
7979
nfs_uuid_t *nfs_uuid;
8080

81-
spin_lock(&nfs_uuid_lock);
81+
spin_lock(&nfs_uuids_lock);
8282
nfs_uuid = nfs_uuid_lookup_locked(uuid);
8383
if (nfs_uuid) {
8484
kref_get(&dom->ref);
@@ -94,7 +94,7 @@ void nfs_uuid_is_local(const uuid_t *uuid, struct list_head *list,
9494
__module_get(mod);
9595
nfsd_mod = mod;
9696
}
97-
spin_unlock(&nfs_uuid_lock);
97+
spin_unlock(&nfs_uuids_lock);
9898
}
9999
EXPORT_SYMBOL_GPL(nfs_uuid_is_local);
100100

@@ -128,9 +128,9 @@ void nfs_localio_disable_client(struct nfs_client *clp)
128128

129129
spin_lock(&nfs_uuid->lock);
130130
if (test_and_clear_bit(NFS_CS_LOCAL_IO, &clp->cl_flags)) {
131-
spin_lock(&nfs_uuid_lock);
131+
spin_lock(&nfs_uuids_lock);
132132
nfs_uuid_put_locked(nfs_uuid);
133-
spin_unlock(&nfs_uuid_lock);
133+
spin_unlock(&nfs_uuids_lock);
134134
}
135135
spin_unlock(&nfs_uuid->lock);
136136
}
@@ -140,23 +140,23 @@ void nfs_localio_invalidate_clients(struct list_head *cl_uuid_list)
140140
{
141141
nfs_uuid_t *nfs_uuid, *tmp;
142142

143-
spin_lock(&nfs_uuid_lock);
143+
spin_lock(&nfs_uuids_lock);
144144
list_for_each_entry_safe(nfs_uuid, tmp, cl_uuid_list, list) {
145145
struct nfs_client *clp =
146146
container_of(nfs_uuid, struct nfs_client, cl_uuid);
147147

148148
nfs_localio_disable_client(clp);
149149
}
150-
spin_unlock(&nfs_uuid_lock);
150+
spin_unlock(&nfs_uuids_lock);
151151
}
152152
EXPORT_SYMBOL_GPL(nfs_localio_invalidate_clients);
153153

154154
static void nfs_uuid_add_file(nfs_uuid_t *nfs_uuid, struct nfs_file_localio *nfl)
155155
{
156-
spin_lock(&nfs_uuid_lock);
156+
spin_lock(&nfs_uuids_lock);
157157
if (!nfl->nfs_uuid)
158158
rcu_assign_pointer(nfl->nfs_uuid, nfs_uuid);
159-
spin_unlock(&nfs_uuid_lock);
159+
spin_unlock(&nfs_uuids_lock);
160160
}
161161

162162
/*
@@ -217,14 +217,14 @@ void nfs_close_local_fh(struct nfs_file_localio *nfl)
217217
ro_nf = rcu_access_pointer(nfl->ro_file);
218218
rw_nf = rcu_access_pointer(nfl->rw_file);
219219
if (ro_nf || rw_nf) {
220-
spin_lock(&nfs_uuid_lock);
220+
spin_lock(&nfs_uuids_lock);
221221
if (ro_nf)
222222
ro_nf = rcu_dereference_protected(xchg(&nfl->ro_file, NULL), 1);
223223
if (rw_nf)
224224
rw_nf = rcu_dereference_protected(xchg(&nfl->rw_file, NULL), 1);
225225

226226
rcu_assign_pointer(nfl->nfs_uuid, NULL);
227-
spin_unlock(&nfs_uuid_lock);
227+
spin_unlock(&nfs_uuids_lock);
228228
rcu_read_unlock();
229229

230230
if (ro_nf)

fs/nfsd/localio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void nfsd_localio_ops_init(void)
5454
* avoid all the NFS overhead with reads, writes and commits.
5555
*
5656
* On successful return, returned nfsd_file will have its nf_net member
57-
* set. Caller (NFS client) is responsible for calling nfsd_serv_put and
57+
* set. Caller (NFS client) is responsible for calling nfsd_net_put and
5858
* nfsd_file_put (via nfs_to_nfsd_file_put_local).
5959
*/
6060
struct nfsd_file *

0 commit comments

Comments
 (0)