linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] f2fs: don't need to get f2fs_lock_op for the inline_data test
@ 2013-12-27  4:00 Jaegeuk Kim
  2013-12-27  4:00 ` [PATCH 2/6] f2fs: convert inline_data for punch_hole Jaegeuk Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jaegeuk Kim @ 2013-12-27  4:00 UTC (permalink / raw)
  Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

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>
---
 fs/f2fs/file.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index dd80e72..7ef2d6a 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);
 
-- 
1.8.4.474.g128a96c


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-06  7:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-27  4:00 [PATCH 1/6] f2fs: don't need to get f2fs_lock_op for the inline_data test Jaegeuk Kim
2013-12-27  4:00 ` [PATCH 2/6] f2fs: convert inline_data for punch_hole Jaegeuk Kim
2013-12-31  6:08   ` [f2fs-dev] " Chao Yu
2014-01-06  7:41     ` Jaegeuk Kim
2013-12-27  4:00 ` [PATCH 3/6] f2fs: call f2fs_put_page at the error case Jaegeuk Kim
2013-12-27  4:00 ` [PATCH 4/6] f2fs: refactor f2fs_convert_inline_data Jaegeuk Kim
2013-12-27  4:00 ` [PATCH 5/6] f2fs: add the number of inline_data files to status info Jaegeuk Kim
2013-12-27  6:15   ` Jaegeuk Kim
2013-12-27  4:00 ` [PATCH 6/6] f2fs: add inline_data recovery routine Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).