aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 68ece4b18916..4fcca4f74940 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -920,42 +920,32 @@ int bdi_writeback_task(struct bdi_writeback *wb)
920} 920}
921 921
922/* 922/*
923 * Schedule writeback for all backing devices. This does WB_SYNC_NONE 923 * Start writeback of `nr_pages' pages. If `nr_pages' is zero, write back
924 * writeback, for integrity writeback see bdi_queue_work_onstack(). 924 * the whole world.
925 */ 925 */
926static void bdi_writeback_all(struct super_block *sb, long nr_pages) 926void wakeup_flusher_threads(long nr_pages)
927{ 927{
928 struct backing_dev_info *bdi;
928 struct wb_writeback_args args = { 929 struct wb_writeback_args args = {
929 .sb = sb,
930 .nr_pages = nr_pages,
931 .sync_mode = WB_SYNC_NONE, 930 .sync_mode = WB_SYNC_NONE,
932 }; 931 };
933 struct backing_dev_info *bdi;
934 932
935 rcu_read_lock(); 933 if (nr_pages) {
934 args.nr_pages = nr_pages;
935 } else {
936 args.nr_pages = global_page_state(NR_FILE_DIRTY) +
937 global_page_state(NR_UNSTABLE_NFS);
938 }
936 939
940 rcu_read_lock();
937 list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { 941 list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) {
938 if (!bdi_has_dirty_io(bdi)) 942 if (!bdi_has_dirty_io(bdi))
939 continue; 943 continue;
940
941 bdi_alloc_queue_work(bdi, &args); 944 bdi_alloc_queue_work(bdi, &args);
942 } 945 }
943
944 rcu_read_unlock(); 946 rcu_read_unlock();
945} 947}
946 948
947/*
948 * Start writeback of `nr_pages' pages. If `nr_pages' is zero, write back
949 * the whole world.
950 */
951void wakeup_flusher_threads(long nr_pages)
952{
953 if (nr_pages == 0)
954 nr_pages = global_page_state(NR_FILE_DIRTY) +
955 global_page_state(NR_UNSTABLE_NFS);
956 bdi_writeback_all(NULL, nr_pages);
957}
958
959static noinline void block_dump___mark_inode_dirty(struct inode *inode) 949static noinline void block_dump___mark_inode_dirty(struct inode *inode)
960{ 950{
961 if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev")) { 951 if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev")) {