aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-05-04 21:54:37 -0400
committerWu Fengguang <fengguang.wu@intel.com>2011-07-10 01:09:01 -0400
commitd46db3d58233be4be980eb1e42eebe7808bcabab (patch)
tree6d813b33938d915f0c0633e8615d1ffdcc554c96 /include/linux/writeback.h
parent36715cef0770b7e2547892b7c3197fc024274630 (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.h6
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 */
25struct writeback_control { 25struct 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);
56int writeback_inodes_sb_if_idle(struct super_block *); 53int writeback_inodes_sb_if_idle(struct super_block *);
57int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); 54int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr);
58void sync_inodes_sb(struct super_block *); 55void sync_inodes_sb(struct super_block *);
59void writeback_inodes_wb(struct bdi_writeback *wb, 56long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages);
60 struct writeback_control *wbc);
61long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 57long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
62void wakeup_flusher_threads(long nr_pages); 58void wakeup_flusher_threads(long nr_pages);
63 59