aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-09-25 18:07:46 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-09-25 18:10:40 -0400
commita72bfd4dea053bb8e2233902c3f1893ef5485802 (patch)
tree1246fc000adfee6d2874b9324eaf7383ad4413bb
parent6d7f18f6ea3a13af95bdf507fc54d42b165e1712 (diff)
writeback: pass in super_block to bdi_start_writeback()
Sometimes we only want to write pages from a specific super_block, so allow that to be passed in. This fixes a problem with commit 56a131dcf7ed36c3c6e36bea448b674ea85ed5bb causing writeback on all super_blocks on a bdi, where we only really want to sync a specific sb from writeback_inodes_sb(). Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--fs/fs-writeback.c6
-rw-r--r--include/linux/backing-dev.h3
-rw-r--r--mm/page-writeback.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index fb61178c86e3..9d5360c4c2af 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -250,9 +250,11 @@ static void bdi_sync_writeback(struct backing_dev_info *bdi,
250 * completion. Caller need not hold sb s_umount semaphore. 250 * completion. Caller need not hold sb s_umount semaphore.
251 * 251 *
252 */ 252 */
253void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages) 253void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
254 long nr_pages)
254{ 255{
255 struct wb_writeback_args args = { 256 struct wb_writeback_args args = {
257 .sb = sb,
256 .sync_mode = WB_SYNC_NONE, 258 .sync_mode = WB_SYNC_NONE,
257 .nr_pages = nr_pages, 259 .nr_pages = nr_pages,
258 .range_cyclic = 1, 260 .range_cyclic = 1,
@@ -1206,7 +1208,7 @@ void writeback_inodes_sb(struct super_block *sb)
1206 nr_to_write = nr_dirty + nr_unstable + 1208 nr_to_write = nr_dirty + nr_unstable +
1207 (inodes_stat.nr_inodes - inodes_stat.nr_unused); 1209 (inodes_stat.nr_inodes - inodes_stat.nr_unused);
1208 1210
1209 bdi_start_writeback(sb->s_bdi, nr_to_write); 1211 bdi_start_writeback(sb->s_bdi, sb, nr_to_write);
1210} 1212}
1211EXPORT_SYMBOL(writeback_inodes_sb); 1213EXPORT_SYMBOL(writeback_inodes_sb);
1212 1214
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 0ee33c2e6129..b449e738533a 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -101,7 +101,8 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
101 const char *fmt, ...); 101 const char *fmt, ...);
102int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 102int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
103void bdi_unregister(struct backing_dev_info *bdi); 103void bdi_unregister(struct backing_dev_info *bdi);
104void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages); 104void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
105 long nr_pages);
105int bdi_writeback_task(struct bdi_writeback *wb); 106int bdi_writeback_task(struct bdi_writeback *wb);
106int bdi_has_dirty_io(struct backing_dev_info *bdi); 107int bdi_has_dirty_io(struct backing_dev_info *bdi);
107 108
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 69b5fbabc8bd..a3b14090b1fb 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -596,7 +596,7 @@ static void balance_dirty_pages(struct address_space *mapping,
596 (!laptop_mode && ((global_page_state(NR_FILE_DIRTY) 596 (!laptop_mode && ((global_page_state(NR_FILE_DIRTY)
597 + global_page_state(NR_UNSTABLE_NFS)) 597 + global_page_state(NR_UNSTABLE_NFS))
598 > background_thresh))) 598 > background_thresh)))
599 bdi_start_writeback(bdi, 0); 599 bdi_start_writeback(bdi, NULL, 0);
600} 600}
601 601
602void set_page_dirty_balance(struct page *page, int page_mkwrite) 602void set_page_dirty_balance(struct page *page, int page_mkwrite)