From c37650161a53c01ddd88587675f9a4adc909a73e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 6 Oct 2010 10:48:20 +0200 Subject: fs: add sync_inode_metadata Add a new helper to write out the inode using the writeback code, that is including the correct dirty bit and list manipulation. A few of filesystems already opencode this, and a lot of others should be using it instead of using write_inode_now which also writes out the data. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro --- fs/exofs/file.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'fs/exofs') diff --git a/fs/exofs/file.c b/fs/exofs/file.c index 68cb23e..b905c79 100644 --- a/fs/exofs/file.c +++ b/fs/exofs/file.c @@ -46,10 +46,6 @@ static int exofs_file_fsync(struct file *filp, int datasync) { int ret; struct inode *inode = filp->f_mapping->host; - struct writeback_control wbc = { - .sync_mode = WB_SYNC_ALL, - .nr_to_write = 0, /* metadata-only; caller takes care of data */ - }; struct super_block *sb; if (!(inode->i_state & I_DIRTY)) @@ -57,7 +53,7 @@ static int exofs_file_fsync(struct file *filp, int datasync) if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) return 0; - ret = sync_inode(inode, &wbc); + ret = sync_inode_metadata(inode, 1); /* This is a good place to write the sb */ /* TODO: Sechedule an sb-sync on create */ -- cgit v1.1