mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
81fca44400
commit
c37650161a
10 changed files with 30 additions and 41 deletions
|
|
@ -892,10 +892,6 @@ EXPORT_SYMBOL_GPL(generic_fh_to_parent);
|
|||
*/
|
||||
int generic_file_fsync(struct file *file, int datasync)
|
||||
{
|
||||
struct writeback_control wbc = {
|
||||
.sync_mode = WB_SYNC_ALL,
|
||||
.nr_to_write = 0, /* metadata-only; caller takes care of data */
|
||||
};
|
||||
struct inode *inode = file->f_mapping->host;
|
||||
int err;
|
||||
int ret;
|
||||
|
|
@ -906,7 +902,7 @@ int generic_file_fsync(struct file *file, int datasync)
|
|||
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
|
||||
return ret;
|
||||
|
||||
err = sync_inode(inode, &wbc);
|
||||
err = sync_inode_metadata(inode, 1);
|
||||
if (ret == 0)
|
||||
ret = err;
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue