From: Daeho Jeong via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Daeho Jeong <daeho43@gmail.com>
Cc: kernel-team@android.com, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: make gc_urgent and gc_segment_mode sysfs node readable
Date: Fri, 18 Mar 2022 12:13:18 -0700 [thread overview]
Message-ID: <CABdZyexJoHaymH5Xqn=TcPLf8ek7H9i3vPE=AJz=6Asd=+nAxw@mail.gmail.com> (raw)
In-Reply-To: <20220318191012.4113266-1-daeho43@gmail.com>
Plz, sorry, ignore this one.
On Fri, Mar 18, 2022 at 12:10 PM Daeho Jeong <daeho43@gmail.com> wrote:
>
> From: Daeho Jeong <daehojeong@google.com>
>
> Changed a way of showing values of them to use strings.
>
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> ---
> fs/f2fs/sysfs.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index fe29bcb70f46..f2613cc83888 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -41,6 +41,16 @@ enum {
> ATGC_INFO, /* struct atgc_management */
> };
>
> +const char *gc_mode_names[MAX_GC_MODE] = {
> + "GC_NORMAL",
> + "GC_IDLE_CB",
> + "GC_IDLE_GREEDY",
> + "GC_IDLE_AT",
> + "GC_URGENT_HIGH",
> + "GC_URGENT_LOW",
> + "GC_URGENT_MID"
> +};
> +
> struct f2fs_attr {
> struct attribute attr;
> ssize_t (*show)(struct f2fs_attr *, struct f2fs_sb_info *, char *);
> @@ -316,8 +326,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
> return sysfs_emit(buf, "%u\n", sbi->compr_new_inode);
> #endif
>
> + if (!strcmp(a->attr.name, "gc_urgent"))
> + return sysfs_emit(buf, "%s\n",
> + gc_mode_names[sbi->gc_mode]);
> +
> if (!strcmp(a->attr.name, "gc_segment_mode"))
> - return sysfs_emit(buf, "%u\n", sbi->gc_segment_mode);
> + return sysfs_emit(buf, "%s\n",
> + gc_mode_names[sbi->gc_segment_mode]);
>
> if (!strcmp(a->attr.name, "gc_reclaimed_segments")) {
> return sysfs_emit(buf, "%u\n",
> --
> 2.35.1.894.gb6a874cedc-goog
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2022-03-18 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 19:10 [f2fs-dev] [PATCH] f2fs: make gc_urgent and gc_segment_mode sysfs node readable Daeho Jeong
2022-03-18 19:13 ` Daeho Jeong via Linux-f2fs-devel [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-18 19:13 Daeho Jeong
2022-03-21 7:20 ` 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='CABdZyexJoHaymH5Xqn=TcPLf8ek7H9i3vPE=AJz=6Asd=+nAxw@mail.gmail.com' \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--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;
as well as URLs for NNTP newsgroup(s).