ext4: use ext4_update_i_disksize instead of opencoded ones
authorDmitry Monakhov <dmonakhov@openvz.org>
Sun, 31 Aug 2014 03:34:06 +0000 (23:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 31 Aug 2014 03:34:06 +0000 (23:34 -0400)
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c

index 8aa241a000c5cb7cb0e88780e2041df5a32d78e6..cc95dca5cb8a2f3f19532d78eac8975c47224273 100644 (file)
@@ -2651,10 +2651,7 @@ static int ext4_da_write_end(struct file *file,
        if (copied && new_i_size > EXT4_I(inode)->i_disksize) {
                if (ext4_has_inline_data(inode) ||
                    ext4_da_should_update_i_disksize(page, end)) {
-                       down_write(&EXT4_I(inode)->i_data_sem);
-                       if (new_i_size > EXT4_I(inode)->i_disksize)
-                               EXT4_I(inode)->i_disksize = new_i_size;
-                       up_write(&EXT4_I(inode)->i_data_sem);
+                       ext4_update_i_disksize(inode, new_i_size);
                        /* We need to mark inode dirty even if
                         * new_i_size is less that inode->i_size
                         * bu greater than i_disksize.(hint delalloc)