diff options
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 3b3dbb94393d..7f079209d70a 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -58,7 +58,6 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode, | |||
58 | struct page *page, | 58 | struct page *page, |
59 | unsigned int offset, unsigned int count) | 59 | unsigned int offset, unsigned int count) |
60 | { | 60 | { |
61 | struct nfs_server *server = NFS_SERVER(inode); | ||
62 | struct nfs_page *req; | 61 | struct nfs_page *req; |
63 | 62 | ||
64 | for (;;) { | 63 | for (;;) { |
@@ -67,7 +66,7 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode, | |||
67 | if (req != NULL) | 66 | if (req != NULL) |
68 | break; | 67 | break; |
69 | 68 | ||
70 | if (signalled() && (server->flags & NFS_MOUNT_INTR)) | 69 | if (fatal_signal_pending(current)) |
71 | return ERR_PTR(-ERESTARTSYS); | 70 | return ERR_PTR(-ERESTARTSYS); |
72 | yield(); | 71 | yield(); |
73 | } | 72 | } |
@@ -177,11 +176,11 @@ void nfs_release_request(struct nfs_page *req) | |||
177 | kref_put(&req->wb_kref, nfs_free_request); | 176 | kref_put(&req->wb_kref, nfs_free_request); |
178 | } | 177 | } |
179 | 178 | ||
180 | static int nfs_wait_bit_interruptible(void *word) | 179 | static int nfs_wait_bit_killable(void *word) |
181 | { | 180 | { |
182 | int ret = 0; | 181 | int ret = 0; |
183 | 182 | ||
184 | if (signal_pending(current)) | 183 | if (fatal_signal_pending(current)) |
185 | ret = -ERESTARTSYS; | 184 | ret = -ERESTARTSYS; |
186 | else | 185 | else |
187 | schedule(); | 186 | schedule(); |
@@ -192,26 +191,18 @@ static int nfs_wait_bit_interruptible(void *word) | |||
192 | * nfs_wait_on_request - Wait for a request to complete. | 191 | * nfs_wait_on_request - Wait for a request to complete. |
193 | * @req: request to wait upon. | 192 | * @req: request to wait upon. |
194 | * | 193 | * |
195 | * Interruptible by signals only if mounted with intr flag. | 194 | * Interruptible by fatal signals only. |
196 | * The user is responsible for holding a count on the request. | 195 | * The user is responsible for holding a count on the request. |
197 | */ | 196 | */ |
198 | int | 197 | int |
199 | nfs_wait_on_request(struct nfs_page *req) | 198 | nfs_wait_on_request(struct nfs_page *req) |
200 | { | 199 | { |
201 | struct rpc_clnt *clnt = NFS_CLIENT(req->wb_context->path.dentry->d_inode); | ||
202 | sigset_t oldmask; | ||
203 | int ret = 0; | 200 | int ret = 0; |
204 | 201 | ||
205 | if (!test_bit(PG_BUSY, &req->wb_flags)) | 202 | if (!test_bit(PG_BUSY, &req->wb_flags)) |
206 | goto out; | 203 | goto out; |
207 | /* | ||
208 | * Note: the call to rpc_clnt_sigmask() suffices to ensure that we | ||
209 | * are not interrupted if intr flag is not set | ||
210 | */ | ||
211 | rpc_clnt_sigmask(clnt, &oldmask); | ||
212 | ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY, | 204 | ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY, |
213 | nfs_wait_bit_interruptible, TASK_INTERRUPTIBLE); | 205 | nfs_wait_bit_killable, TASK_KILLABLE); |
214 | rpc_clnt_sigunmask(clnt, &oldmask); | ||
215 | out: | 206 | out: |
216 | return ret; | 207 | return ret; |
217 | } | 208 | } |