diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-09 13:19:15 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-09 15:17:34 -0400 |
commit | 7ad84aa9448571678c243f0c5ef383fbe5b50f4f (patch) | |
tree | 7d2baea4ff52fe62b23bf8adbb81a824ee768938 /include/linux/nfs_page.h | |
parent | d1182b33ed9b62470cb6ab892a8a301542120086 (diff) |
NFS: Clean up - simplify nfs_lock_request()
We only have two places where we need to grab a reference when trying
to lock the nfs_page. We're better off making that explicit.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'include/linux/nfs_page.h')
-rw-r--r-- | include/linux/nfs_page.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index ef7504215446..263f30a5e10d 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -99,24 +99,14 @@ extern void nfs_unlock_request(struct nfs_page *req); extern void nfs_unlock_request_dont_release(struct nfs_page *req); /* - * Lock the page of an asynchronous request without getting a new reference + * Lock the page of an asynchronous request */ static inline int -nfs_lock_request_dontget(struct nfs_page *req) -{ - return !test_and_set_bit(PG_BUSY, &req->wb_flags); -} - -static inline int nfs_lock_request(struct nfs_page *req) { - if (test_and_set_bit(PG_BUSY, &req->wb_flags)) - return 0; - kref_get(&req->wb_kref); - return 1; + return !test_and_set_bit(PG_BUSY, &req->wb_flags); } - /** * nfs_list_add_request - Insert a request into a list * @req: request |