[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1457666938-14518-1-git-send-email-shawn.lin@rock-chips.com>
Date: Fri, 11 Mar 2016 11:28:58 +0800
From: Shawn Lin <shawn.lin@...k-chips.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>
Cc: linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net,
Shawn Lin <shawn.lin@...k-chips.com>
Subject: [PATCH 5/8] f2fs: f2fs: check inline flag ahead for f2fs_inline_data_fiemap
No matter inline data flag is set or not, get_node_page is
going work now. But actually we can avoid it by puting the
check of inline data flag in advance to save this cpu cycle.
Signed-off-by: Shawn Lin <shawn.lin@...k-chips.com>
---
fs/f2fs/inline.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 69a4806..394feee 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -566,15 +566,13 @@ int f2fs_inline_data_fiemap(struct inode *inode,
struct page *ipage;
int err = 0;
+ if (!f2fs_has_inline_data(inode))
+ return -EAGAIN;
+
ipage = get_node_page(F2FS_I_SB(inode), inode->i_ino);
if (IS_ERR(ipage))
return PTR_ERR(ipage);
- if (!f2fs_has_inline_data(inode)) {
- err = -EAGAIN;
- goto out;
- }
-
ilen = min_t(size_t, MAX_INLINE_DATA, i_size_read(inode));
if (start >= ilen)
goto out;
--
2.3.7
Powered by blists - more mailing lists