[PATCH 5/8] f2fs: f2fs: check inline flag ahead for f2fs_inline_data_fiemap

From: Shawn Lin
Date: Thu Mar 10 2016 - 22:37:14 EST


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@xxxxxxxxxxxxxx>
---

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