Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2763
b: refs/heads/master
c: 464a98b
h: refs/heads/master
i:
  2761: b61b207
  2759: cb6aaae
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 22, 2005
1 parent 5169d6a commit 6b08c14
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96651ab341cde0fee940ec837f323d711cbfa7d5
refs/heads/master: 464a98bd70bae8c559cfc82af799faf44824ce64
1 change: 0 additions & 1 deletion trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,6 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rp
ctx->state = NULL;
ctx->lockowner = current->files;
ctx->error = 0;
init_waitqueue_head(&ctx->waitq);
}
return ctx;
}
Expand Down
35 changes: 28 additions & 7 deletions trunk/fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void nfs_unlock_request(struct nfs_page *req)
smp_mb__before_clear_bit();
clear_bit(PG_BUSY, &req->wb_flags);
smp_mb__after_clear_bit();
wake_up_all(&req->wb_context->waitq);
wake_up_bit(&req->wb_flags, PG_BUSY);
nfs_release_request(req);
}

Expand Down Expand Up @@ -180,6 +180,17 @@ nfs_list_add_request(struct nfs_page *req, struct list_head *head)
req->wb_list_head = head;
}

static int nfs_wait_bit_interruptible(void *word)
{
int ret = 0;

if (signal_pending(current))
ret = -ERESTARTSYS;
else
schedule();
return ret;
}

/**
* nfs_wait_on_request - Wait for a request to complete.
* @req: request to wait upon.
Expand All @@ -190,12 +201,22 @@ nfs_list_add_request(struct nfs_page *req, struct list_head *head)
int
nfs_wait_on_request(struct nfs_page *req)
{
struct inode *inode = req->wb_context->dentry->d_inode;
struct rpc_clnt *clnt = NFS_CLIENT(inode);

if (!NFS_WBACK_BUSY(req))
return 0;
return nfs_wait_event(clnt, req->wb_context->waitq, !NFS_WBACK_BUSY(req));
struct rpc_clnt *clnt = NFS_CLIENT(req->wb_context->dentry->d_inode);
sigset_t oldmask;
int ret = 0;

if (!test_bit(PG_BUSY, &req->wb_flags))
goto out;
/*
* Note: the call to rpc_clnt_sigmask() suffices to ensure that we
* are not interrupted if intr flag is not set
*/
rpc_clnt_sigmask(clnt, &oldmask);
ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY,
nfs_wait_bit_interruptible, TASK_INTERRUPTIBLE);
rpc_clnt_sigunmask(clnt, &oldmask);
out:
return ret;
}

/**
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ struct nfs_open_context {
int error;

struct list_head list;
wait_queue_head_t waitq;
};

/*
Expand Down

0 comments on commit 6b08c14

Please sign in to comment.