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
|
|
@ -281,23 +281,13 @@ commit_metadata(struct svc_fh *fhp)
|
|||
{
|
||||
struct inode *inode = fhp->fh_dentry->d_inode;
|
||||
const struct export_operations *export_ops = inode->i_sb->s_export_op;
|
||||
int error = 0;
|
||||
|
||||
if (!EX_ISSYNC(fhp->fh_export))
|
||||
return 0;
|
||||
|
||||
if (export_ops->commit_metadata) {
|
||||
error = export_ops->commit_metadata(inode);
|
||||
} else {
|
||||
struct writeback_control wbc = {
|
||||
.sync_mode = WB_SYNC_ALL,
|
||||
.nr_to_write = 0, /* metadata only */
|
||||
};
|
||||
|
||||
error = sync_inode(inode, &wbc);
|
||||
}
|
||||
|
||||
return error;
|
||||
if (export_ops->commit_metadata)
|
||||
return export_ops->commit_metadata(inode);
|
||||
return sync_inode_metadata(inode, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue