ext4: use sync_inode_metadata() when syncing inode metadata
authorGuo Chao <yan@linux.vnet.ibm.com>
Mon, 10 Dec 2012 19:06:03 +0000 (14:06 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 10 Dec 2012 19:06:03 +0000 (14:06 -0500)
We have a dedicated interface to sync inode metadata.  Use it to
simplify ext4's code some.

Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
fs/ext4/fsync.c

index be1d89f..dfbc1fe 100644 (file)
@@ -44,7 +44,6 @@
  */
 static int ext4_sync_parent(struct inode *inode)
 {
-       struct writeback_control wbc;
        struct dentry *dentry = NULL;
        struct inode *next;
        int ret = 0;
@@ -66,10 +65,7 @@ static int ext4_sync_parent(struct inode *inode)
                ret = sync_mapping_buffers(inode->i_mapping);
                if (ret)
                        break;
-               memset(&wbc, 0, sizeof(wbc));
-               wbc.sync_mode = WB_SYNC_ALL;
-               wbc.nr_to_write = 0;         /* only write out the inode */
-               ret = sync_inode(inode, &wbc);
+               ret = sync_inode_metadata(inode, 1);
                if (ret)
                        break;
        }