aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs/inode.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-07-12 10:28:49 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 15:58:09 -0400
commit5687b5780e90278a62d4cd916a3632087066f59d (patch)
tree362f5c4b25cc1edd9ae69ac561192859cfd9c201 /fs/hfs/inode.c
parentb16ca626358cbf056b752eab63ba8f20087afeaf (diff)
hfs: get rid of hfs_sync_super
This patch makes hfs stop using the VFS '->write_super()' method along with the 's_dirt' superblock flag, because they are on their way out. The whole "superblock write-out" VFS infrastructure is served by the 'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and writes out all dirty superblocks using the '->write_super()' call-back. But the problem with this thread is that it wastes power by waking up the system every 5 seconds, even if there are no diry superblocks, or there are no client file-systems which would need this (e.g., btrfs does not use '->write_super()'). So we want to kill it completely and thus, we need to make file-systems to stop using the '->write_super()' VFS service, and then remove it together with the kernel thread. Tested using fsstress from the LTP project. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hfs/inode.c')
-rw-r--r--fs/hfs/inode.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 90c1ccbff8e4..ee1bc55677f1 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -220,7 +220,7 @@ struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode)
220 insert_inode_hash(inode); 220 insert_inode_hash(inode);
221 mark_inode_dirty(inode); 221 mark_inode_dirty(inode);
222 set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags); 222 set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags);
223 sb->s_dirt = 1; 223 hfs_mark_mdb_dirty(sb);
224 224
225 return inode; 225 return inode;
226} 226}
@@ -235,7 +235,7 @@ void hfs_delete_inode(struct inode *inode)
235 if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID)) 235 if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID))
236 HFS_SB(sb)->root_dirs--; 236 HFS_SB(sb)->root_dirs--;
237 set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags); 237 set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags);
238 sb->s_dirt = 1; 238 hfs_mark_mdb_dirty(sb);
239 return; 239 return;
240 } 240 }
241 HFS_SB(sb)->file_count--; 241 HFS_SB(sb)->file_count--;
@@ -248,7 +248,7 @@ void hfs_delete_inode(struct inode *inode)
248 } 248 }
249 } 249 }
250 set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags); 250 set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags);
251 sb->s_dirt = 1; 251 hfs_mark_mdb_dirty(sb);
252} 252}
253 253
254void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext, 254void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext,
@@ -644,10 +644,7 @@ static int hfs_file_fsync(struct file *filp, loff_t start, loff_t end,
644 644
645 /* sync the superblock to buffers */ 645 /* sync the superblock to buffers */
646 sb = inode->i_sb; 646 sb = inode->i_sb;
647 if (sb->s_dirt) { 647 flush_delayed_work_sync(&HFS_SB(sb)->mdb_work);
648 sb->s_dirt = 0;
649 hfs_mdb_commit(sb);
650 }
651 /* .. finally sync the buffers to disk */ 648 /* .. finally sync the buffers to disk */
652 err = sync_blockdev(sb->s_bdev); 649 err = sync_blockdev(sb->s_bdev);
653 if (!ret) 650 if (!ret)