f2fs: no need lock_op in f2fs_write_inline_data
authorYunlei He <heyunlei@huawei.com>
Thu, 23 Feb 2017 12:31:20 +0000 (20:31 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 27 Feb 2017 17:59:55 +0000 (09:59 -0800)
Similar as f2fs_write_inode, f2fs_write_inline_data just
mark inode page dirty, so it's no need to write inline data
under read lock of cp_rwsem.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 80f9863dc4b0cf8b7561b65fe139d33b8084a05e..9e51c5e40ce16e36569286cecdd0729ec56f2b46 100644 (file)
@@ -1414,9 +1414,12 @@ write:
                goto redirty_out;
 
        err = -EAGAIN;
-       f2fs_lock_op(sbi);
-       if (f2fs_has_inline_data(inode))
+       if (f2fs_has_inline_data(inode)) {
                err = f2fs_write_inline_data(inode, page);
+               if (!err)
+                       goto out;
+       }
+       f2fs_lock_op(sbi);
        if (err == -EAGAIN)
                err = do_write_data_page(&fio);
        if (F2FS_I(inode)->last_disk_size < psize)