Skip to contentSkip to conversation

f2fs: remove a redundant conditional expression

PATCH In review LiFan 2 participants 2 messages Nov 28, 2017 – Nov 30, 2017 1 message not in the archive F2FS file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20171128121829epcas5p1d7a840229243b79f5b82d56d0b4dc38d@epcas5p1.samsung.com

LiFan

author
#1 lore raw

PATCH 1/1 f2fs: remove a redundant conditional expression

Avoid checking is_inode repeatedly, and make the logic a little bit clearer.

---
 fs/f2fs/f2fs.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/f2fs/f2fs.h +4 -4
index 4acdca4..95cc4ef 100644
@@ -1995,11 +1995,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);
Signature · 1 line
2.7.4