Commit cbf5577a authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by James Toy

This patch adds new operation to struct super_operations - sync_inodes,

generic implementaion and changes fs-writeback.c:sync_sb_inodes() to call
filesystem's sync_inodes if it is defined or generic implementaion otherwise.
This new operation allows filesystem to decide itself what to flush.

Reiser4 flushes dirty pages on basic of atoms, not of inodes.  sync_sb_inodes
used to call address space flushing method (writepages) for every dirty inode.
 For reiser4 it caused having to commit atoms unnecessarily often.  This
turned into substantial slowdown.  Having this method helped to fix that
problem.

akpm: this patch needs to be chnaged to remove the `sb' arg.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Edward Shishkin <edward.shishkin@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent d3155d0f
...@@ -1175,6 +1175,9 @@ long sync_inodes_sb(struct super_block *sb) ...@@ -1175,6 +1175,9 @@ long sync_inodes_sb(struct super_block *sb)
long nr_to_write = LONG_MAX; /* doesn't actually matter */ long nr_to_write = LONG_MAX; /* doesn't actually matter */
wbc.nr_to_write = nr_to_write; wbc.nr_to_write = nr_to_write;
if (sb->s_op->sync_inodes)
sb->s_op->sync_inodes(sb, &wbc);
else
bdi_writeback_all(&wbc); bdi_writeback_all(&wbc);
wait_sb_inodes(&wbc); wait_sb_inodes(&wbc);
return nr_to_write - wbc.nr_to_write; return nr_to_write - wbc.nr_to_write;
......
...@@ -1569,6 +1569,8 @@ struct super_operations { ...@@ -1569,6 +1569,8 @@ struct super_operations {
void (*clear_inode) (struct inode *); void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *); void (*umount_begin) (struct super_block *);
void (*sync_inodes)(struct super_block *sb,
struct writeback_control *wbc);
int (*show_options)(struct seq_file *, struct vfsmount *); int (*show_options)(struct seq_file *, struct vfsmount *);
int (*show_stats)(struct seq_file *, struct vfsmount *); int (*show_stats)(struct seq_file *, struct vfsmount *);
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment