mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
fs: move i_wb_list out from under inode_lock
Protect the inode writeback list with a new global lock inode_wb_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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
55fa6091d8
commit
a66979abad
8 changed files with 70 additions and 48 deletions
|
|
@ -73,14 +73,14 @@ static int bdi_debug_stats_show(struct seq_file *m, void *v)
|
|||
struct inode *inode;
|
||||
|
||||
nr_wb = nr_dirty = nr_io = nr_more_io = 0;
|
||||
spin_lock(&inode_lock);
|
||||
spin_lock(&inode_wb_list_lock);
|
||||
list_for_each_entry(inode, &wb->b_dirty, i_wb_list)
|
||||
nr_dirty++;
|
||||
list_for_each_entry(inode, &wb->b_io, i_wb_list)
|
||||
nr_io++;
|
||||
list_for_each_entry(inode, &wb->b_more_io, i_wb_list)
|
||||
nr_more_io++;
|
||||
spin_unlock(&inode_lock);
|
||||
spin_unlock(&inode_wb_list_lock);
|
||||
|
||||
global_dirty_limits(&background_thresh, &dirty_thresh);
|
||||
bdi_thresh = bdi_dirty_limit(bdi, dirty_thresh);
|
||||
|
|
@ -682,11 +682,11 @@ void bdi_destroy(struct backing_dev_info *bdi)
|
|||
if (bdi_has_dirty_io(bdi)) {
|
||||
struct bdi_writeback *dst = &default_backing_dev_info.wb;
|
||||
|
||||
spin_lock(&inode_lock);
|
||||
spin_lock(&inode_wb_list_lock);
|
||||
list_splice(&bdi->wb.b_dirty, &dst->b_dirty);
|
||||
list_splice(&bdi->wb.b_io, &dst->b_io);
|
||||
list_splice(&bdi->wb.b_more_io, &dst->b_more_io);
|
||||
spin_unlock(&inode_lock);
|
||||
spin_unlock(&inode_wb_list_lock);
|
||||
}
|
||||
|
||||
bdi_unregister(bdi);
|
||||
|
|
|
|||
Loading…
Reference in a new issue