diff options
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 68851ff2fd41..30f6f27d5a59 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -723,7 +723,7 @@ static long __writeback_inodes_wb(struct bdi_writeback *wb, | |||
723 | return wrote; | 723 | return wrote; |
724 | } | 724 | } |
725 | 725 | ||
726 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, | 726 | static long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, |
727 | enum wb_reason reason) | 727 | enum wb_reason reason) |
728 | { | 728 | { |
729 | struct wb_writeback_work work = { | 729 | struct wb_writeback_work work = { |
@@ -1049,10 +1049,8 @@ void wakeup_flusher_threads(long nr_pages, enum wb_reason reason) | |||
1049 | { | 1049 | { |
1050 | struct backing_dev_info *bdi; | 1050 | struct backing_dev_info *bdi; |
1051 | 1051 | ||
1052 | if (!nr_pages) { | 1052 | if (!nr_pages) |
1053 | nr_pages = global_page_state(NR_FILE_DIRTY) + | 1053 | nr_pages = get_nr_dirty_pages(); |
1054 | global_page_state(NR_UNSTABLE_NFS); | ||
1055 | } | ||
1056 | 1054 | ||
1057 | rcu_read_lock(); | 1055 | rcu_read_lock(); |
1058 | list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { | 1056 | list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { |
@@ -1173,6 +1171,8 @@ void __mark_inode_dirty(struct inode *inode, int flags) | |||
1173 | bool wakeup_bdi = false; | 1171 | bool wakeup_bdi = false; |
1174 | bdi = inode_to_bdi(inode); | 1172 | bdi = inode_to_bdi(inode); |
1175 | 1173 | ||
1174 | spin_unlock(&inode->i_lock); | ||
1175 | spin_lock(&bdi->wb.list_lock); | ||
1176 | if (bdi_cap_writeback_dirty(bdi)) { | 1176 | if (bdi_cap_writeback_dirty(bdi)) { |
1177 | WARN(!test_bit(BDI_registered, &bdi->state), | 1177 | WARN(!test_bit(BDI_registered, &bdi->state), |
1178 | "bdi-%s not registered\n", bdi->name); | 1178 | "bdi-%s not registered\n", bdi->name); |
@@ -1187,8 +1187,6 @@ void __mark_inode_dirty(struct inode *inode, int flags) | |||
1187 | wakeup_bdi = true; | 1187 | wakeup_bdi = true; |
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | spin_unlock(&inode->i_lock); | ||
1191 | spin_lock(&bdi->wb.list_lock); | ||
1192 | inode->dirtied_when = jiffies; | 1190 | inode->dirtied_when = jiffies; |
1193 | list_move(&inode->i_wb_list, &bdi->wb.b_dirty); | 1191 | list_move(&inode->i_wb_list, &bdi->wb.b_dirty); |
1194 | spin_unlock(&bdi->wb.list_lock); | 1192 | spin_unlock(&bdi->wb.list_lock); |