Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69176
b: refs/heads/master
c: ed90ef5
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent 4071c35 commit 3952dde
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 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: 90e9a3f9b0a14198a8ae5a0a5c13ad30f0b8b40d
refs/heads/master: ed90ef51a33f572fa7d00c8b05f7457be727e74f
2 changes: 1 addition & 1 deletion trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)

/* Flush out writes to the server in order to update c/mtime */
if (S_ISREG(inode->i_mode))
nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT);
nfs_wb_nocommit(inode);

/*
* We may force a getattr if the user cares about atime.
Expand Down
41 changes: 14 additions & 27 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,12 +1325,8 @@ long nfs_sync_mapping_wait(struct address_space *mapping, struct writeback_contr
return ret;
}

/*
* flush the inode to disk.
*/
int nfs_wb_all(struct inode *inode)
static int nfs_write_mapping(struct address_space *mapping, int how)
{
struct address_space *mapping = inode->i_mapping;
struct writeback_control wbc = {
.bdi = mapping->backing_dev_info,
.sync_mode = WB_SYNC_ALL,
Expand All @@ -1343,35 +1339,26 @@ int nfs_wb_all(struct inode *inode)
ret = nfs_writepages(mapping, &wbc);
if (ret < 0)
goto out;
ret = nfs_sync_mapping_wait(mapping, &wbc, 0);
if (ret >= 0)
return 0;
ret = nfs_sync_mapping_wait(mapping, &wbc, how);
if (ret < 0)
goto out;
return 0;
out:
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
return ret;
}

int nfs_sync_mapping_range(struct address_space *mapping, loff_t range_start, loff_t range_end, int how)
/*
* flush the inode to disk.
*/
int nfs_wb_all(struct inode *inode)
{
struct writeback_control wbc = {
.bdi = mapping->backing_dev_info,
.sync_mode = WB_SYNC_ALL,
.nr_to_write = LONG_MAX,
.range_start = range_start,
.range_end = range_end,
.for_writepages = 1,
};
int ret;
return nfs_write_mapping(inode->i_mapping, 0);
}

ret = nfs_writepages(mapping, &wbc);
if (ret < 0)
goto out;
ret = nfs_sync_mapping_wait(mapping, &wbc, how);
if (ret >= 0)
return 0;
out:
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
return ret;
int nfs_wb_nocommit(struct inode *inode)
{
return nfs_write_mapping(inode->i_mapping, FLUSH_NOCOMMIT);
}

int nfs_wb_page_cancel(struct inode *inode, struct page *page)
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ extern void nfs_writedata_release(void *);
* return value!)
*/
extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
extern int nfs_wb_all(struct inode *inode);
extern int nfs_wb_nocommit(struct inode *inode);
extern int nfs_wb_page(struct inode *inode, struct page* page);
extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
Expand Down

0 comments on commit 3952dde

Please sign in to comment.