Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308593
b: refs/heads/master
c: 3aff4eb
h: refs/heads/master
i:
  308591: 7e5f466
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 9, 2012
1 parent b8dd08e commit f4ef5d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 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: dc327ed4cd320be689596365372a3683208c3ba0
refs/heads/master: 3aff4ebb95b20ad8db2c1447e8c52097d89af5a7
12 changes: 10 additions & 2 deletions trunk/fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,
}

/**
* nfs_unlock_request - Unlock request and wake up sleepers.
* nfs_unlock_request_dont_release - Unlock request and wake up sleepers.
* @req:
*/
void nfs_unlock_request(struct nfs_page *req)
void nfs_unlock_request_dont_release(struct nfs_page *req)
{
if (!NFS_WBACK_BUSY(req)) {
printk(KERN_ERR "NFS: Invalid unlock attempted\n");
Expand All @@ -141,6 +141,14 @@ void nfs_unlock_request(struct nfs_page *req)
clear_bit(PG_BUSY, &req->wb_flags);
smp_mb__after_clear_bit();
wake_up_bit(&req->wb_flags, PG_BUSY);
}

/**
* nfs_unlock_request - Unlock request and release the nfs_page
*/
void nfs_unlock_request(struct nfs_page *req)
{
nfs_unlock_request_dont_release(req);
nfs_release_request(req);
}

Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,9 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
remove_req:
nfs_inode_remove_request(req);
next:
nfs_unlock_request(req);
nfs_unlock_request_dont_release(req);
nfs_end_page_writeback(page);
nfs_release_request(req);
}
out:
hdr->release(hdr);
Expand Down Expand Up @@ -1042,8 +1043,9 @@ static void nfs_redirty_request(struct nfs_page *req)
struct page *page = req->wb_page;

nfs_mark_request_dirty(req);
nfs_unlock_request(req);
nfs_unlock_request_dont_release(req);
nfs_end_page_writeback(page);
nfs_release_request(req);
}

static void nfs_async_write_error(struct list_head *head)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/nfs_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
struct nfs_page *req);
extern int nfs_wait_on_request(struct nfs_page *);
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
Expand Down

0 comments on commit f4ef5d5

Please sign in to comment.