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: improve sbi status info in debugfs/f2fs/status
Date: Tue, 10 Aug 2021 21:27:07 +0800 [thread overview]
Message-ID: <20210810132707.349147-2-frank.li@vivo.com> (raw)
In-Reply-To: <20210810132707.349147-1-frank.li@vivo.com>
Do not use numbers but strings to improve readability.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/debug.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 473ad04d1891..91c0910b0bb7 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -323,22 +323,40 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
#endif
}
+static char *s_flag[] = {
+ [SBI_IS_DIRTY] = " dirty",
+ [SBI_IS_CLOSE] = " close",
+ [SBI_NEED_FSCK] = " fsck",
+ [SBI_POR_DOING] = " doing",
+ [SBI_NEED_SB_WRITE] = " sb_write",
+ [SBI_NEED_CP] = " cp",
+ [SBI_IS_SHUTDOWN] = " shutdown",
+ [SBI_IS_RECOVERED] = " recovered",
+ [SBI_CP_DISABLED] = " cp_disabled",
+ [SBI_CP_DISABLED_QUICK] = " cp_disabled_quick",
+ [SBI_QUOTA_NEED_FLUSH] = " quota_need_flush",
+ [SBI_QUOTA_SKIP_FLUSH] = " quota_skip_flush",
+ [SBI_QUOTA_NEED_REPAIR] = " quota_need_repair",
+ [SBI_IS_RESIZEFS] = " resizefs",
+};
+
static int stat_show(struct seq_file *s, void *v)
{
struct f2fs_stat_info *si;
- int i = 0;
- int j;
+ int i = 0, j = 0;
mutex_lock(&f2fs_stat_mutex);
list_for_each_entry(si, &f2fs_stat_list, stat_list) {
update_general_status(si->sbi);
- seq_printf(s, "\n=====[ partition info(%pg). #%d, %s, CP: %s (sbi: 0x%lx)]=====\n",
+ seq_printf(s, "\n=====[ partition info(%pg). #%d, %s, CP: %s (sbi:",
si->sbi->sb->s_bdev, i++,
f2fs_readonly(si->sbi->sb) ? "RO": "RW",
is_set_ckpt_flags(si->sbi, CP_DISABLED_FLAG) ?
- "Disabled": (f2fs_cp_error(si->sbi) ? "Error": "Good"),
- si->sbi->s_flag);
+ "Disabled" : (f2fs_cp_error(si->sbi) ? "Error" : "Good"));
+ for_each_set_bit(j, &si->sbi->s_flag, 32)
+ seq_puts(s, s_flag[j]);
+ seq_puts(s, ") ]=====\n");
seq_printf(s, "[SB: 1] [CP: 2] [SIT: %d] [NAT: %d] ",
si->sit_area_segs, si->nat_area_segs);
seq_printf(s, "[SSA: %d] [MAIN: %d",
--
2.32.0
next prev parent reply other threads:[~2021-08-10 13:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 13:27 [PATCH] f2fs: correct comment in segment.h Yangtao Li
2021-08-10 13:27 ` Yangtao Li [this message]
2021-08-11 2:25 ` [f2fs-dev] [PATCH] f2fs: improve sbi status info in debugfs/f2fs/status Chao Yu
2021-08-11 2:08 ` [f2fs-dev] [PATCH] f2fs: correct comment in segment.h 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=20210810132707.349147-2-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®