Make filemap_fdatawrite and filemap_flush calls inlined. This needs to move WB_SYNC_* definitions from writeback.h to fs.h. writeback.h requires fs.h, so it creates no problem. Signed-off-by: Mikulas Patocka Index: linux-2.6.26-rc5-devel/include/linux/fs.h =================================================================== --- linux-2.6.26-rc5-devel.orig/include/linux/fs.h 2008-06-20 22:15:45.000000000 +0200 +++ linux-2.6.26-rc5-devel/include/linux/fs.h 2008-06-20 22:40:16.000000000 +0200 @@ -1731,8 +1731,6 @@ extern int invalidate_inode_pages2_range(struct address_space *mapping, pgoff_t start, pgoff_t end); extern int write_inode_now(struct inode *, int); -extern int filemap_fdatawrite(struct address_space *); -extern int filemap_flush(struct address_space *); extern int filemap_fdatawait(struct address_space *); extern int filemap_write_and_wait(struct address_space *mapping); extern int filemap_write_and_wait_range(struct address_space *mapping, @@ -1742,6 +1740,38 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, loff_t start, loff_t end, int sync_mode); +/* + * fs/fs-writeback.c + */ +enum writeback_sync_modes { + WB_SYNC_NONE, /* Don't wait on anything */ + WB_SYNC_ALL, /* Wait on every mapping */ + WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */ +}; + +static inline int __filemap_fdatawrite(struct address_space *mapping, + int sync_mode) +{ + return __filemap_fdatawrite_range(mapping, 0, LLONG_MAX, sync_mode); +} + +static inline int filemap_fdatawrite(struct address_space *mapping) +{ + return __filemap_fdatawrite(mapping, WB_SYNC_ALL); +} + +/** + * filemap_flush - mostly a non-blocking flush + * @mapping: target address_space + * + * This is a mostly non-blocking flush. Not suitable for data-integrity + * purposes - I/O may not be started against all dirty pages. + */ +static inline int filemap_flush(struct address_space *mapping) +{ + return __filemap_fdatawrite(mapping, WB_SYNC_NONE); +} + extern long do_fsync(struct file *file, int datasync); extern void sync_supers(void); extern void sync_filesystems(int wait); Index: linux-2.6.26-rc5-devel/include/linux/writeback.h =================================================================== --- linux-2.6.26-rc5-devel.orig/include/linux/writeback.h 2008-06-20 22:15:45.000000000 +0200 +++ linux-2.6.26-rc5-devel/include/linux/writeback.h 2008-06-20 22:18:56.000000000 +0200 @@ -25,15 +25,6 @@ #define current_is_pdflush() task_is_pdflush(current) /* - * fs/fs-writeback.c - */ -enum writeback_sync_modes { - WB_SYNC_NONE, /* Don't wait on anything */ - WB_SYNC_ALL, /* Wait on every mapping */ - WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */ -}; - -/* * A control structure which tells the writeback code what to do. These are * always on the stack, and hence need no locking. They are always initialised * in a manner such that unspecified fields are set to zero. Index: linux-2.6.26-rc5-devel/mm/filemap.c =================================================================== --- linux-2.6.26-rc5-devel.orig/mm/filemap.c 2008-06-20 22:15:38.000000000 +0200 +++ linux-2.6.26-rc5-devel/mm/filemap.c 2008-06-20 22:18:55.000000000 +0200 @@ -223,39 +223,15 @@ ret = do_writepages(mapping, &wbc); return ret; } +EXPORT_SYMBOL(__filemap_fdatawrite_range); -static inline int __filemap_fdatawrite(struct address_space *mapping, - int sync_mode) -{ - return __filemap_fdatawrite_range(mapping, 0, LLONG_MAX, sync_mode); -} - -int filemap_fdatawrite(struct address_space *mapping) -{ - return __filemap_fdatawrite(mapping, WB_SYNC_ALL); -} -EXPORT_SYMBOL(filemap_fdatawrite); - -static int filemap_fdatawrite_range(struct address_space *mapping, loff_t start, +static inline int filemap_fdatawrite_range(struct address_space *mapping, loff_t start, loff_t end) { return __filemap_fdatawrite_range(mapping, start, end, WB_SYNC_ALL); } /** - * filemap_flush - mostly a non-blocking flush - * @mapping: target address_space - * - * This is a mostly non-blocking flush. Not suitable for data-integrity - * purposes - I/O may not be started against all dirty pages. - */ -int filemap_flush(struct address_space *mapping) -{ - return __filemap_fdatawrite(mapping, WB_SYNC_NONE); -} -EXPORT_SYMBOL(filemap_flush); - -/** * wait_on_page_writeback_range - wait for writeback to complete * @mapping: target address_space * @start: beginning page index