Skip to content

Commit 1344b7e

Browse files
committed
NFS: Remove unused parameter from nfs_page_group_lock()
nfs_page_group_lock() is now always called with the 'nonblock' parameter set to 'false'. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent dee8304 commit 1344b7e

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

fs/nfs/pagelist.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,14 @@ EXPORT_SYMBOL_GPL(nfs_async_iocounter_wait);
134134
/*
135135
* nfs_page_group_lock - lock the head of the page group
136136
* @req - request in group that is to be locked
137-
* @nonblock - if true don't block waiting for lock
138137
*
139-
* this lock must be held if modifying the page group list
138+
* this lock must be held when traversing or modifying the page
139+
* group list
140140
*
141-
* return 0 on success, < 0 on error: -EDELAY if nonblocking or the
142-
* result from wait_on_bit_lock
143-
*
144-
* NOTE: calling with nonblock=false should always have set the
145-
* lock bit (see fs/buffer.c and other uses of wait_on_bit_lock
146-
* with TASK_UNINTERRUPTIBLE), so there is no need to check the result.
141+
* return 0 on success, < 0 on error
147142
*/
148143
int
149-
nfs_page_group_lock(struct nfs_page *req, bool nonblock)
144+
nfs_page_group_lock(struct nfs_page *req)
150145
{
151146
struct nfs_page *head = req->wb_head;
152147

@@ -155,14 +150,10 @@ nfs_page_group_lock(struct nfs_page *req, bool nonblock)
155150
if (!test_and_set_bit(PG_HEADLOCK, &head->wb_flags))
156151
return 0;
157152

158-
if (!nonblock) {
159-
set_bit(PG_CONTENDED1, &head->wb_flags);
160-
smp_mb__after_atomic();
161-
return wait_on_bit_lock(&head->wb_flags, PG_HEADLOCK,
153+
set_bit(PG_CONTENDED1, &head->wb_flags);
154+
smp_mb__after_atomic();
155+
return wait_on_bit_lock(&head->wb_flags, PG_HEADLOCK,
162156
TASK_UNINTERRUPTIBLE);
163-
}
164-
165-
return -EAGAIN;
166157
}
167158

168159
/*
@@ -225,7 +216,7 @@ bool nfs_page_group_sync_on_bit(struct nfs_page *req, unsigned int bit)
225216
{
226217
bool ret;
227218

228-
nfs_page_group_lock(req, false);
219+
nfs_page_group_lock(req);
229220
ret = nfs_page_group_sync_on_bit_locked(req, bit);
230221
nfs_page_group_unlock(req);
231222

@@ -1016,7 +1007,7 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
10161007
unsigned int bytes_left = 0;
10171008
unsigned int offset, pgbase;
10181009

1019-
nfs_page_group_lock(req, false);
1010+
nfs_page_group_lock(req);
10201011

10211012
subreq = req;
10221013
bytes_left = subreq->wb_bytes;
@@ -1038,7 +1029,7 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
10381029
if (mirror->pg_recoalesce)
10391030
return 0;
10401031
/* retry add_request for this subreq */
1041-
nfs_page_group_lock(req, false);
1032+
nfs_page_group_lock(req);
10421033
continue;
10431034
}
10441035

@@ -1135,7 +1126,7 @@ int nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
11351126

11361127
for (midx = 0; midx < desc->pg_mirror_count; midx++) {
11371128
if (midx) {
1138-
nfs_page_group_lock(req, false);
1129+
nfs_page_group_lock(req);
11391130

11401131
/* find the last request */
11411132
for (lastreq = req->wb_head;

fs/nfs/write.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static bool nfs_page_group_covers_page(struct nfs_page *req)
271271
unsigned int pos = 0;
272272
unsigned int len = nfs_page_length(req->wb_page);
273273

274-
nfs_page_group_lock(req, false);
274+
nfs_page_group_lock(req);
275275

276276
do {
277277
tmp = nfs_page_group_search_locked(req->wb_head, pos);
@@ -480,7 +480,7 @@ nfs_lock_and_join_requests(struct page *page)
480480
}
481481
spin_unlock(&inode->i_lock);
482482

483-
ret = nfs_page_group_lock(head, false);
483+
ret = nfs_page_group_lock(head);
484484
if (ret < 0) {
485485
nfs_unlock_and_release_request(head);
486486
return ERR_PTR(ret);
@@ -501,7 +501,7 @@ nfs_lock_and_join_requests(struct page *page)
501501
nfs_page_group_unlock(head);
502502
ret = nfs_wait_on_request(subreq);
503503
if (!ret)
504-
ret = nfs_page_group_lock(head, false);
504+
ret = nfs_page_group_lock(head);
505505
if (ret < 0) {
506506
nfs_unroll_locks(inode, head, subreq);
507507
nfs_release_request(subreq);

include/linux/nfs_page.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ extern size_t nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
139139
extern int nfs_wait_on_request(struct nfs_page *);
140140
extern void nfs_unlock_request(struct nfs_page *req);
141141
extern void nfs_unlock_and_release_request(struct nfs_page *);
142-
extern int nfs_page_group_lock(struct nfs_page *, bool);
142+
extern int nfs_page_group_lock(struct nfs_page *);
143143
extern void nfs_page_group_unlock(struct nfs_page *);
144144
extern bool nfs_page_group_sync_on_bit(struct nfs_page *, unsigned int);
145145
extern bool nfs_async_iocounter_wait(struct rpc_task *, struct nfs_lock_context *);

0 commit comments

Comments
 (0)