linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: remove a redundant conditional expression
       [not found] <CGME20171128121829epcas5p1d7a840229243b79f5b82d56d0b4dc38d@epcas5p1.samsung.com>
@ 2017-11-28 12:17 ` LiFan
  2017-11-30  7:07   ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: LiFan @ 2017-11-28 12:17 UTC (permalink / raw)
  To: 'Chao Yu', 'Chao Yu', 'Jaegeuk Kim'
  Cc: linux-kernel, linux-f2fs-devel

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

Signed-off-by: Fan li <fanofcode.li@samsung.com>
---
 fs/f2fs/f2fs.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 4acdca4..95cc4ef 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -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);
-- 
2.7.4

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

* Re: [f2fs-dev] [PATCH] f2fs: remove a redundant conditional expression
  2017-11-28 12:17 ` [f2fs-dev] [PATCH] f2fs: remove a redundant conditional expression LiFan
@ 2017-11-30  7:07   ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-11-30  7:07 UTC (permalink / raw)
  To: LiFan, 'Chao Yu', 'Jaegeuk Kim'
  Cc: linux-kernel, linux-f2fs-devel

On 2017/11/28 20:17, LiFan wrote:
> 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>

Thanks,

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

end of thread, other threads:[~2017-11-30  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20171128121829epcas5p1d7a840229243b79f5b82d56d0b4dc38d@epcas5p1.samsung.com>
2017-11-28 12:17 ` [f2fs-dev] [PATCH] f2fs: remove a redundant conditional expression LiFan
2017-11-30  7:07   ` Chao Yu

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).