Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42517
b: refs/heads/master
c: 87a4ce1
h: refs/heads/master
i:
  42515: 5b67708
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 6, 2006
1 parent 47affda commit ed749a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 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: 49a70f278658894d2899824cd4037095fb6711fe
refs/heads/master: 87a4ce16082e92b4b6d27596a517b302f3692650
16 changes: 1 addition & 15 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,12 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
struct nfs_open_context *ctx;
struct inode *inode = page->mapping->host;
unsigned offset;
int inode_referenced = 0;
int priority = wb_priority(wbc);
int err;

nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1);

/*
* Note: We need to ensure that we have a reference to the inode
* if we are to do asynchronous writes. If not, waiting
* in nfs_wait_on_request() may deadlock with clear_inode().
*
* If igrab() fails here, then it is in any case safe to
* call nfs_wb_page(), since there will be no pending writes.
*/
if (igrab(inode) != 0)
inode_referenced = 1;

/* Ensure we've flushed out any previous writes */
nfs_wb_page_priority(inode, page, priority);

Expand All @@ -349,7 +337,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
goto out;
}
lock_kernel();
if (!IS_SYNC(inode) && inode_referenced) {
if (!IS_SYNC(inode)) {
err = nfs_writepage_async(ctx, inode, page, 0, offset);
if (!wbc->for_writepages)
nfs_flush_mapping(page->mapping, wbc, wb_priority(wbc));
Expand All @@ -366,8 +354,6 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
put_nfs_open_context(ctx);
out:
unlock_page(page);
if (inode_referenced)
iput(inode);
return err;
}

Expand Down

0 comments on commit ed749a2

Please sign in to comment.