Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46081
b: refs/heads/master
c: d30c834
h: refs/heads/master
i:
  46079: a05d720
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 3, 2007
1 parent 7300c46 commit 186bc69
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 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: f40313ac39fedca519c36fdc454acf2632e641da
refs/heads/master: d30c8348a4ba292a09addd122de2f3189c21a7ff
15 changes: 10 additions & 5 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,18 @@ nfs_fattr_to_ino_t(struct nfs_fattr *fattr)

int nfs_write_inode(struct inode *inode, int sync)
{
int flags = sync ? FLUSH_SYNC : 0;
int ret;

ret = nfs_commit_inode(inode, flags);
if (ret < 0)
return ret;
return 0;
if (sync) {
ret = filemap_fdatawait(inode->i_mapping);
if (ret == 0)
ret = nfs_commit_inode(inode, FLUSH_SYNC);
} else
ret = nfs_commit_inode(inode, 0);
if (ret >= 0)
return 0;
__mark_inode_dirty(inode, I_DIRTY_DATASYNC);
return ret;
}

void nfs_clear_inode(struct inode *inode)
Expand Down
21 changes: 1 addition & 20 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context*,
unsigned int, unsigned int);
static void nfs_mark_request_dirty(struct nfs_page *req);
static int nfs_wait_on_write_congestion(struct address_space *, int);
static int nfs_wait_on_requests(struct inode *, unsigned long, unsigned int);
static long nfs_flush_mapping(struct address_space *mapping, struct writeback_control *wbc, int how);
static const struct rpc_call_ops nfs_write_partial_ops;
static const struct rpc_call_ops nfs_write_full_ops;
Expand Down Expand Up @@ -360,14 +359,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
if (err < 0)
goto out;
nfs_add_stats(inode, NFSIOS_WRITEPAGES, err);
if (!wbc->nonblocking && wbc->sync_mode == WB_SYNC_ALL) {
err = nfs_wait_on_requests(inode, 0, 0);
if (err < 0)
goto out;
}
err = nfs_commit_inode(inode, wb_priority(wbc));
if (err > 0)
err = 0;
err = 0;
out:
clear_bit(BDI_write_congested, &bdi->state);
wake_up_all(&nfs_write_congestion);
Expand Down Expand Up @@ -516,17 +508,6 @@ static int nfs_wait_on_requests_locked(struct inode *inode, unsigned long idx_st
return res;
}

static int nfs_wait_on_requests(struct inode *inode, unsigned long idx_start, unsigned int npages)
{
struct nfs_inode *nfsi = NFS_I(inode);
int ret;

spin_lock(&nfsi->req_lock);
ret = nfs_wait_on_requests_locked(inode, idx_start, npages);
spin_unlock(&nfsi->req_lock);
return ret;
}

static void nfs_cancel_dirty_list(struct list_head *head)
{
struct nfs_page *req;
Expand Down

0 comments on commit 186bc69

Please sign in to comment.