Commit f185ff97 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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: default avatarJaegeuk Kim <>
parent e4024e86
......@@ -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));
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)
err = truncate_inode_blocks(inode, free_from);
/* lastly zero out the first data page */
truncate_partial_data_page(inode, from);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment