aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-12-26 21:01:54 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-12-26 22:40:41 -0500
commitf185ff979f97943c9d4966ed4edc9819c3342c5b (patch)
treeb9037bff2c40d3941a9adf693a699ce61af388db /fs/f2fs/file.c
parente4024e86c28d9b7b297b35d3a697faad44e1e19c (diff)
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 <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c9
1 files changed, 4 insertions, 5 deletions
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)
261 261
262 trace_f2fs_truncate_blocks_enter(inode, from); 262 trace_f2fs_truncate_blocks_enter(inode, from);
263 263
264 if (f2fs_has_inline_data(inode))
265 goto done;
266
264 free_from = (pgoff_t) 267 free_from = (pgoff_t)
265 ((from + blocksize - 1) >> (sbi->log_blocksize)); 268 ((from + blocksize - 1) >> (sbi->log_blocksize));
266 269
267 f2fs_lock_op(sbi); 270 f2fs_lock_op(sbi);
268 271
269 if (f2fs_has_inline_data(inode))
270 goto done;
271
272 set_new_dnode(&dn, inode, NULL, NULL, 0); 272 set_new_dnode(&dn, inode, NULL, NULL, 0);
273 err = get_dnode_of_data(&dn, free_from, LOOKUP_NODE); 273 err = get_dnode_of_data(&dn, free_from, LOOKUP_NODE);
274 if (err) { 274 if (err) {
@@ -295,9 +295,8 @@ static int truncate_blocks(struct inode *inode, u64 from)
295 f2fs_put_dnode(&dn); 295 f2fs_put_dnode(&dn);
296free_next: 296free_next:
297 err = truncate_inode_blocks(inode, free_from); 297 err = truncate_inode_blocks(inode, free_from);
298done:
299 f2fs_unlock_op(sbi); 298 f2fs_unlock_op(sbi);
300 299done:
301 /* lastly zero out the first data page */ 300 /* lastly zero out the first data page */
302 truncate_partial_data_page(inode, from); 301 truncate_partial_data_page(inode, from);
303 302