diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2011-05-04 21:54:37 -0400 |
---|---|---|
committer | Wu Fengguang <fengguang.wu@intel.com> | 2011-07-10 01:09:01 -0400 |
commit | d46db3d58233be4be980eb1e42eebe7808bcabab (patch) | |
tree | 6d813b33938d915f0c0633e8615d1ffdcc554c96 /include/linux/writeback.h | |
parent | 36715cef0770b7e2547892b7c3197fc024274630 (diff) |
writeback: make writeback_control.nr_to_write straight
Pass struct wb_writeback_work all the way down to writeback_sb_inodes(),
and initialize the struct writeback_control there.
struct writeback_control is basically designed to control writeback of a
single file, but we keep abuse it for writing multiple files in
writeback_sb_inodes() and its callers.
It immediately clean things up, e.g. suddenly wbc.nr_to_write vs
work->nr_pages starts to make sense, and instead of saving and restoring
pages_skipped in writeback_sb_inodes it can always start with a clean
zero value.
It also makes a neat IO pattern change: large dirty files are now
written in the full 4MB writeback chunk size, rather than whatever
remained quota in wbc->nr_to_write.
Acked-by: Jan Kara <jack@suse.cz>
Proposed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r-- | include/linux/writeback.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 2f1b512bd6e0..df1b7f18f100 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -24,12 +24,9 @@ enum writeback_sync_modes { | |||
24 | */ | 24 | */ |
25 | struct writeback_control { | 25 | struct writeback_control { |
26 | enum writeback_sync_modes sync_mode; | 26 | enum writeback_sync_modes sync_mode; |
27 | unsigned long *older_than_this; /* If !NULL, only write back inodes | ||
28 | older than this */ | ||
29 | long nr_to_write; /* Write this many pages, and decrement | 27 | long nr_to_write; /* Write this many pages, and decrement |
30 | this for each page written */ | 28 | this for each page written */ |
31 | long pages_skipped; /* Pages which were not written */ | 29 | long pages_skipped; /* Pages which were not written */ |
32 | long inodes_written; /* # of inodes written (at least) */ | ||
33 | 30 | ||
34 | /* | 31 | /* |
35 | * For a_ops->writepages(): is start or end are non-zero then this is | 32 | * For a_ops->writepages(): is start or end are non-zero then this is |
@@ -56,8 +53,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr); | |||
56 | int writeback_inodes_sb_if_idle(struct super_block *); | 53 | int writeback_inodes_sb_if_idle(struct super_block *); |
57 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); | 54 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); |
58 | void sync_inodes_sb(struct super_block *); | 55 | void sync_inodes_sb(struct super_block *); |
59 | void writeback_inodes_wb(struct bdi_writeback *wb, | 56 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages); |
60 | struct writeback_control *wbc); | ||
61 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 57 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |
62 | void wakeup_flusher_threads(long nr_pages); | 58 | void wakeup_flusher_threads(long nr_pages); |
63 | 59 | ||