Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69177
b: refs/heads/master
c: 34901f7
h: refs/heads/master
i:
  69175: 4071c35
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent 3952dde commit 3f5662f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 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: ed90ef51a33f572fa7d00c8b05f7457be727e74f
refs/heads/master: 34901f70d119d88126e7390351b8c780646628e1
32 changes: 22 additions & 10 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,21 +1325,14 @@ long nfs_sync_mapping_wait(struct address_space *mapping, struct writeback_contr
return ret;
}

static int nfs_write_mapping(struct address_space *mapping, int how)
static int __nfs_write_mapping(struct address_space *mapping, struct writeback_control *wbc, int how)
{
struct writeback_control wbc = {
.bdi = mapping->backing_dev_info,
.sync_mode = WB_SYNC_ALL,
.nr_to_write = LONG_MAX,
.for_writepages = 1,
.range_cyclic = 1,
};
int ret;

ret = nfs_writepages(mapping, &wbc);
ret = nfs_writepages(mapping, wbc);
if (ret < 0)
goto out;
ret = nfs_sync_mapping_wait(mapping, &wbc, how);
ret = nfs_sync_mapping_wait(mapping, wbc, how);
if (ret < 0)
goto out;
return 0;
Expand All @@ -1348,6 +1341,25 @@ static int nfs_write_mapping(struct address_space *mapping, int how)
return ret;
}

/* Two pass sync: first using WB_SYNC_NONE, then WB_SYNC_ALL */
static int nfs_write_mapping(struct address_space *mapping, int how)
{
struct writeback_control wbc = {
.bdi = mapping->backing_dev_info,
.sync_mode = WB_SYNC_NONE,
.nr_to_write = LONG_MAX,
.for_writepages = 1,
.range_cyclic = 1,
};
int ret;

ret = __nfs_write_mapping(mapping, &wbc, how);
if (ret < 0)
return ret;
wbc.sync_mode = WB_SYNC_ALL;
return __nfs_write_mapping(mapping, &wbc, how);
}

/*
* flush the inode to disk.
*/
Expand Down

0 comments on commit 3f5662f

Please sign in to comment.