From: Yangtao Li <frank.li@vivo.com>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Yangtao Li <frank.li@vivo.com>
Subject: [PATCH] f2fs: change value of recovery to bool
Date: Mon, 16 Aug 2021 20:28:07 +0800 [thread overview]
Message-ID: <20210816122807.71400-1-frank.li@vivo.com> (raw)
Recovery has only two values, 0 and 1, let's change it to bool type.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/super.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8fecd3050ccd..98727e04d271 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3541,7 +3541,7 @@ static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
*/
static int read_raw_super_block(struct f2fs_sb_info *sbi,
struct f2fs_super_block **raw_super,
- int *valid_super_block, int *recovery)
+ int *valid_super_block, bool *recovery)
{
struct super_block *sb = sbi->sb;
int block;
@@ -3559,7 +3559,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,
f2fs_err(sbi, "Unable to read %dth superblock",
block + 1);
err = -EIO;
- *recovery = 1;
+ *recovery = true;
continue;
}
@@ -3569,7 +3569,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi,
f2fs_err(sbi, "Can't find valid F2FS filesystem in %dth superblock",
block + 1);
brelse(bh);
- *recovery = 1;
+ *recovery = true;
continue;
}
@@ -3784,15 +3784,16 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
int err;
bool skip_recovery = false, need_fsck = false;
char *options = NULL;
- int recovery, i, valid_super_block;
+ int i, valid_super_block;
struct curseg_info *seg_i;
int retry_cnt = 1;
+ bool recovery;
try_onemore:
err = -EINVAL;
raw_super = NULL;
valid_super_block = -1;
- recovery = 0;
+ recovery = false;
/* allocate memory for f2fs-specific super block info */
sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL);
--
2.32.0
next reply other threads:[~2021-08-16 12:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 12:28 Yangtao Li [this message]
2021-08-17 0:30 ` Jaegeuk Kim
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=20210816122807.71400-1-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®