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); | |||
99 | extern void nfs_unlock_request_dont_release(struct nfs_page *req); | 99 | extern void nfs_unlock_request_dont_release(struct nfs_page *req); |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * Lock the page of an asynchronous request without getting a new reference | 102 | * Lock the page of an asynchronous request |
103 | */ | 103 | */ |
104 | static inline int | 104 | static inline int |
105 | nfs_lock_request_dontget(struct nfs_page *req) | ||
106 | { | ||
107 | return !test_and_set_bit(PG_BUSY, &req->wb_flags); | ||
108 | } | ||
109 | |||
110 | static inline int | ||
111 | nfs_lock_request(struct nfs_page *req) | 105 | nfs_lock_request(struct nfs_page *req) |
112 | { | 106 | { |
113 | if (test_and_set_bit(PG_BUSY, &req->wb_flags)) | 107 | return !test_and_set_bit(PG_BUSY, &req->wb_flags); |
114 | return 0; | ||
115 | kref_get(&req->wb_kref); | ||
116 | return 1; | ||
117 | } | 108 | } |
118 | 109 | ||
119 | |||
120 | /** | 110 | /** |
121 | * nfs_list_add_request - Insert a request into a list | 111 | * nfs_list_add_request - Insert a request into a list |
122 | * @req: request | 112 | * @req: request |