aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-03-22 07:23:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-24 21:16:32 -0400
commit55fa6091d83160ca772fc37cebae45d42695a708 (patch)
tree4df49f372032e30449e1a2dd64daf443e20b781c /fs/fs-writeback.c
parentf283c86afe6aa70b733d1ecebad5d9464943b774 (diff)
fs: move i_sb_list out from under inode_lock
Protect the per-sb inode list with a new global lock inode_sb_list_lock and use it to protect the list manipulations and traversals. This lock replaces the inode_lock as the inodes on the list can be validity checked while holding the inode->i_lock and hence the inode_lock is no longer needed to protect the list. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index efd1ebe879cc..5de56a2182bb 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1123,7 +1123,7 @@ static void wait_sb_inodes(struct super_block *sb)
1123 */ 1123 */
1124 WARN_ON(!rwsem_is_locked(&sb->s_umount)); 1124 WARN_ON(!rwsem_is_locked(&sb->s_umount));
1125 1125
1126 spin_lock(&inode_lock); 1126 spin_lock(&inode_sb_list_lock);
1127 1127
1128 /* 1128 /*
1129 * Data integrity sync. Must wait for all pages under writeback, 1129 * Data integrity sync. Must wait for all pages under writeback,
@@ -1143,14 +1143,15 @@ static void wait_sb_inodes(struct super_block *sb)
1143 } 1143 }
1144 __iget(inode); 1144 __iget(inode);
1145 spin_unlock(&inode->i_lock); 1145 spin_unlock(&inode->i_lock);
1146 spin_unlock(&inode_lock); 1146 spin_unlock(&inode_sb_list_lock);
1147
1147 /* 1148 /*
1148 * We hold a reference to 'inode' so it couldn't have 1149 * We hold a reference to 'inode' so it couldn't have been
1149 * been removed from s_inodes list while we dropped the 1150 * removed from s_inodes list while we dropped the
1150 * inode_lock. We cannot iput the inode now as we can 1151 * inode_sb_list_lock. We cannot iput the inode now as we can
1151 * be holding the last reference and we cannot iput it 1152 * be holding the last reference and we cannot iput it under
1152 * under inode_lock. So we keep the reference and iput 1153 * inode_sb_list_lock. So we keep the reference and iput it
1153 * it later. 1154 * later.
1154 */ 1155 */
1155 iput(old_inode); 1156 iput(old_inode);
1156 old_inode = inode; 1157 old_inode = inode;
@@ -1159,9 +1160,9 @@ static void wait_sb_inodes(struct super_block *sb)
1159 1160
1160 cond_resched(); 1161 cond_resched();
1161 1162
1162 spin_lock(&inode_lock); 1163 spin_lock(&inode_sb_list_lock);
1163 } 1164 }
1164 spin_unlock(&inode_lock); 1165 spin_unlock(&inode_sb_list_lock);
1165 iput(old_inode); 1166 iput(old_inode);
1166} 1167}
1167 1168