f2fs: remove a redundant conditional expression
authorLiFan <fanofcode.li@samsung.com>
Tue, 28 Nov 2017 12:17:41 +0000 (20:17 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 3 Jan 2018 03:27:29 +0000 (19:27 -0800)
Avoid checking is_inode repeatedly, and make the logic
a little bit clearer.

Signed-off-by: Fan li <fanofcode.li@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h

index 8bbb162..f3b4619 100644 (file)
@@ -1996,11 +1996,11 @@ static inline block_t datablock_addr(struct inode *inode,
        raw_node = F2FS_NODE(node_page);
 
        /* from GC path only */
-       if (!inode) {
-               if (is_inode)
+       if (is_inode) {
+               if (!inode)
                        base = offset_in_addr(&raw_node->i);
-       } else if (f2fs_has_extra_attr(inode) && is_inode) {
-               base = get_extra_isize(inode);
+               else if (f2fs_has_extra_attr(inode))
+                       base = get_extra_isize(inode);
        }
 
        addr_array = blkaddr_in_node(raw_node);