Skip to content

Commit

Permalink
NFS: Clean up nfs_create_request()
Browse files Browse the repository at this point in the history
There is no point in looping if we're out of memory.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 14, 2010
1 parent 1f4c86c commit 18eb884
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,10 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,
{
struct nfs_page *req;

for (;;) {
/* try to allocate the request struct */
req = nfs_page_alloc();
if (req != NULL)
break;

if (fatal_signal_pending(current))
return ERR_PTR(-ERESTARTSYS);
yield();
}
/* try to allocate the request struct */
req = nfs_page_alloc();
if (req == NULL)
return ERR_PTR(-ENOMEM);

/* Initialize the request struct. Initially, we assume a
* long write-back delay. This will be adjusted in
Expand Down

0 comments on commit 18eb884

Please sign in to comment.