Rearrange of inode_lock in writeback_inodes()
PATCH 1/1 Rearrange of inode_lock in writeback_inodes()
This patch reaaranges inode_lock taking in writeback_inodes().
It narrows down use of inode_lock and removes unneccassary nesting of sb_lock and inode_lock. Instead of holding inode_lock for all the time I moved it around sync_sb_inodes() as it is in all other places.
Signed-off-by Kirill Korotaev <[email protected]>
Kirill
fs/fs-writeback.c renamed from fs/fs-writeback.c.sblock +4 -3
@@ -392,7 +392,6 @@ writeback_inodes(struct writeback_contro {struct super_block *sb; -spin_lock (&inode_lock);spin_lock (&sb_lock); restart: sb =sb_entry (super_blocks.prev);
@@ -407,8 +406,11 @@ restart:* be unmounted by the time it is released. */ if (down_read_trylock (&sb->s_umount)) { -if (sb->s_root) +if (sb->s_root) { +spin_lock (&inode_lock);sync_sb_inodes (sb, wbc); +spin_unlock (&inode_lock); + }up_read (&sb->s_umount); }spin_lock (&sb_lock);
@@ -425,7 +427,6 @@ restart:break ; }spin_unlock (&sb_lock); -spin_unlock (&inode_lock); }/*