diff options
| author | Christoph Hellwig <hch@lst.de> | 2010-10-06 04:48:20 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:18:19 -0400 |
| commit | c37650161a53c01ddd88587675f9a4adc909a73e (patch) | |
| tree | 85821998de9a6723dedc42488b9491db9692d1e3 /fs/libfs.c | |
| parent | 81fca444001e5a41ab80ce8cf9a5734c00ec6546 (diff) | |
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 <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/libfs.c')
| -rw-r--r-- | fs/libfs.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/libfs.c b/fs/libfs.c index 62baa0387d6e..2dbf4877d7ef 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
| @@ -892,10 +892,6 @@ EXPORT_SYMBOL_GPL(generic_fh_to_parent); | |||
| 892 | */ | 892 | */ |
| 893 | int generic_file_fsync(struct file *file, int datasync) | 893 | int generic_file_fsync(struct file *file, int datasync) |
| 894 | { | 894 | { |
| 895 | struct writeback_control wbc = { | ||
| 896 | .sync_mode = WB_SYNC_ALL, | ||
| 897 | .nr_to_write = 0, /* metadata-only; caller takes care of data */ | ||
| 898 | }; | ||
| 899 | struct inode *inode = file->f_mapping->host; | 895 | struct inode *inode = file->f_mapping->host; |
| 900 | int err; | 896 | int err; |
| 901 | int ret; | 897 | int ret; |
| @@ -906,7 +902,7 @@ int generic_file_fsync(struct file *file, int datasync) | |||
| 906 | if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) | 902 | if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) |
| 907 | return ret; | 903 | return ret; |
| 908 | 904 | ||
| 909 | err = sync_inode(inode, &wbc); | 905 | err = sync_inode_metadata(inode, 1); |
| 910 | if (ret == 0) | 906 | if (ret == 0) |
| 911 | ret = err; | 907 | ret = err; |
| 912 | return ret; | 908 | return ret; |
