linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Junling Zheng <zhengjunling@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] dump.f2fs: correct the seg type in ssa_dump
Date: Tue, 6 Feb 2018 16:47:14 +0800	[thread overview]
Message-ID: <20180206084714.136306-1-zhengjunling@huawei.com> (raw)

Fix the mixed using of "ret" in ssa_dump.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
---
 fsck/dump.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fsck/dump.c b/fsck/dump.c
index 8772a62..23e4f47 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -195,7 +195,7 @@ void ssa_dump(struct f2fs_sb_info *sbi, int start_ssa, int end_ssa)
 {
 	struct f2fs_summary_block *sum_blk;
 	char buf[BUF_SZ];
-	int segno, i, ret;
+	int segno, type, i, ret;
 	int fd;
 
 	fd = open("dump_ssa", O_CREAT|O_WRONLY|O_TRUNC, 0666);
@@ -208,10 +208,10 @@ void ssa_dump(struct f2fs_sb_info *sbi, int start_ssa, int end_ssa)
 	ASSERT(ret >= 0);
 
 	for (segno = start_ssa; segno < end_ssa; segno++) {
-		sum_blk = get_sum_block(sbi, segno, &ret);
+		sum_blk = get_sum_block(sbi, segno, &type);
 
 		memset(buf, 0, BUF_SZ);
-		switch (ret) {
+		switch (type) {
 		case SEG_TYPE_CUR_NODE:
 			snprintf(buf, BUF_SZ, "\n\nsegno: %x, Current Node\n", segno);
 			break;
@@ -240,8 +240,8 @@ void ssa_dump(struct f2fs_sb_info *sbi, int start_ssa, int end_ssa)
 			ret = write(fd, buf, strlen(buf));
 			ASSERT(ret >= 0);
 		}
-		if (ret == SEG_TYPE_NODE || ret == SEG_TYPE_DATA ||
-					ret == SEG_TYPE_MAX)
+		if (type == SEG_TYPE_NODE || type == SEG_TYPE_DATA ||
+					type == SEG_TYPE_MAX)
 			free(sum_blk);
 	}
 	close(fd);
-- 
2.15.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

             reply	other threads:[~2018-02-06  8:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06  8:47 Junling Zheng [this message]
2018-02-09 13:20 ` [PATCH] dump.f2fs: correct the seg type in ssa_dump Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180206084714.136306-1-zhengjunling@huawei.com \
    --to=zhengjunling@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).