From: Jaegeuk Kim Date: Fri, 27 Dec 2013 02:01:54 +0000 (+0900) Subject: f2fs: don't need to get f2fs_lock_op for the inline_data test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f185ff979f97943c9d4966ed4edc9819c3342c5b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git f2fs: don't need to get f2fs_lock_op for the inline_data test This patch locates checking the inline_data prior to calling f2fs_lock_op() in truncate_blocks(), since getting the lock is unnecessary. Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index dd80e725acb6..7ef2d6af24ce 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -261,14 +261,14 @@ static int truncate_blocks(struct inode *inode, u64 from) trace_f2fs_truncate_blocks_enter(inode, from); + if (f2fs_has_inline_data(inode)) + goto done; + free_from = (pgoff_t) ((from + blocksize - 1) >> (sbi->log_blocksize)); f2fs_lock_op(sbi); - if (f2fs_has_inline_data(inode)) - goto done; - set_new_dnode(&dn, inode, NULL, NULL, 0); err = get_dnode_of_data(&dn, free_from, LOOKUP_NODE); if (err) { @@ -295,9 +295,8 @@ static int truncate_blocks(struct inode *inode, u64 from) f2fs_put_dnode(&dn); free_next: err = truncate_inode_blocks(inode, free_from); -done: f2fs_unlock_op(sbi); - +done: /* lastly zero out the first data page */ truncate_partial_data_page(inode, from);