aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-05 03:21:37 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-03-05 13:25:52 -0500
commita9185b41a4f84971b930c519f0c63bd450c4810d (patch)
tree268cf4e206cca12fb9e1dd68984e7c190e465b46 /fs/ext2
parent26821ed40b4230259e770c9911180f38fcaa6f59 (diff)
pass writeback_control to ->write_inode
This gives the filesystem more information about the writeback that is happening. Trond requested this for the NFS unstable write handling, and other filesystems might benefit from this too by beeing able to distinguish between the different callers in more detail. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/ext2.h2
-rw-r--r--fs/ext2/inode.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index 061914add3cf..0b038e47ad2f 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -118,7 +118,7 @@ extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
118 118
119/* inode.c */ 119/* inode.c */
120extern struct inode *ext2_iget (struct super_block *, unsigned long); 120extern struct inode *ext2_iget (struct super_block *, unsigned long);
121extern int ext2_write_inode (struct inode *, int); 121extern int ext2_write_inode (struct inode *, struct writeback_control *);
122extern void ext2_delete_inode (struct inode *); 122extern void ext2_delete_inode (struct inode *);
123extern int ext2_sync_inode (struct inode *); 123extern int ext2_sync_inode (struct inode *);
124extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int); 124extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 71b032c65a02..36ae1cac767c 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -41,6 +41,8 @@ MODULE_AUTHOR("Remy Card and others");
41MODULE_DESCRIPTION("Second Extended Filesystem"); 41MODULE_DESCRIPTION("Second Extended Filesystem");
42MODULE_LICENSE("GPL"); 42MODULE_LICENSE("GPL");
43 43
44static int __ext2_write_inode(struct inode *inode, int do_sync);
45
44/* 46/*
45 * Test whether an inode is a fast symlink. 47 * Test whether an inode is a fast symlink.
46 */ 48 */
@@ -64,7 +66,7 @@ void ext2_delete_inode (struct inode * inode)
64 goto no_delete; 66 goto no_delete;
65 EXT2_I(inode)->i_dtime = get_seconds(); 67 EXT2_I(inode)->i_dtime = get_seconds();
66 mark_inode_dirty(inode); 68 mark_inode_dirty(inode);
67 ext2_write_inode(inode, inode_needs_sync(inode)); 69 __ext2_write_inode(inode, inode_needs_sync(inode));
68 70
69 inode->i_size = 0; 71 inode->i_size = 0;
70 if (inode->i_blocks) 72 if (inode->i_blocks)
@@ -1335,7 +1337,7 @@ bad_inode:
1335 return ERR_PTR(ret); 1337 return ERR_PTR(ret);
1336} 1338}
1337 1339
1338int ext2_write_inode(struct inode *inode, int do_sync) 1340static int __ext2_write_inode(struct inode *inode, int do_sync)
1339{ 1341{
1340 struct ext2_inode_info *ei = EXT2_I(inode); 1342 struct ext2_inode_info *ei = EXT2_I(inode);
1341 struct super_block *sb = inode->i_sb; 1343 struct super_block *sb = inode->i_sb;
@@ -1440,6 +1442,11 @@ int ext2_write_inode(struct inode *inode, int do_sync)
1440 return err; 1442 return err;
1441} 1443}
1442 1444
1445int ext2_write_inode(struct inode *inode, struct writeback_control *wbc)
1446{
1447 return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
1448}
1449
1443int ext2_sync_inode(struct inode *inode) 1450int ext2_sync_inode(struct inode *inode)
1444{ 1451{
1445 struct writeback_control wbc = { 1452 struct writeback_control wbc = {