aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2007-05-11 01:22:51 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 11:29:35 -0400
commit0ea971801625184a91a6d80ea85e53875caa0bf5 (patch)
tree6f4144b7ba809fccfe6d75314df8c348596c9a01 /include/linux/writeback.h
parente10cc1df1d2014f68a4bdcf73f6dd122c4561f94 (diff)
consolidate generic_writepages and mpage_writepages
Clean up massive code duplication between mpage_writepages() and generic_writepages(). The new generic function, write_cache_pages() takes a function pointer argument, which will be called for each page to be written. Maybe cifs_writepages() too can use this infrastructure, but I'm not touching that with a ten-foot pole. The upcoming page writeback support in fuse will also want this. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index daa6c125f66e..050915b59576 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -111,9 +111,15 @@ balance_dirty_pages_ratelimited(struct address_space *mapping)
111 balance_dirty_pages_ratelimited_nr(mapping, 1); 111 balance_dirty_pages_ratelimited_nr(mapping, 1);
112} 112}
113 113
114typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
115 void *data);
116
114int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); 117int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
115extern int generic_writepages(struct address_space *mapping, 118int generic_writepages(struct address_space *mapping,
116 struct writeback_control *wbc); 119 struct writeback_control *wbc);
120int write_cache_pages(struct address_space *mapping,
121 struct writeback_control *wbc, writepage_t writepage,
122 void *data);
117int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 123int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
118int sync_page_range(struct inode *inode, struct address_space *mapping, 124int sync_page_range(struct inode *inode, struct address_space *mapping,
119 loff_t pos, loff_t count); 125 loff_t pos, loff_t count);