Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1016438pxp; Sun, 20 Mar 2022 03:50:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSnYPkjbU/Ot2ILeE/I5ys1luO9TMRn00+hHzV/2lB/Tl7FOpzSeEXFEho9o/2AxXyCv+w X-Received: by 2002:a17:906:6a13:b0:6db:ab28:9f00 with SMTP id qw19-20020a1709066a1300b006dbab289f00mr16321598ejc.296.1647773401632; Sun, 20 Mar 2022 03:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647773401; cv=none; d=google.com; s=arc-20160816; b=HjW8m8iBEvElZeipwxQ7y02Ay9KtZaWWVxeLDbZo6d1be4c1X8fHF/XFIqKPRZXNpg sX8ZWTQA4SSmUIEEVSW/bQXE+jjbW95Ws81qxw1Y8MskYDMFR2Z1+Ee9tpktKylAmdsl NtwK+LYkhZlIXSS9GFMPQnRBzVs8tLFhGwuS4v2SELx1SN9ls/6+sAyo/p5oOkuzDElE LaauPKBqZcqWLGBG9XbgOH5kcGkoBbqm5o8zvHE8enD3g/QvGyhQpI0cn3x1PGi8SL1N hfnjhZml9/81pzXEvjiCLHgYkD1G7SXsWFK6TqEwjitLZQl4XaxW/RlVWNTuYWfln+cA EcfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZS9ok05PYKlNZu1rxfnTOBmw2CBJcOeQT2M61z+cNaM=; b=N96+f8fjRGhCDnBu18mbKlhhJXP3/nUnBo084wmMsadheysXpovJuyblqnDn3uzbfc Dpwy2WLFNmWOJg6KbgwV1/++I9h2zRiK/9e1YO3vjVIF2BkD9yZHqQ6Z6ggRVN6vbReC 15Nl99Zrkwts+R/Tw1jnnHz1R01MCHukSunernu7Xo6hkx6ZWn9Z18rrc4CCrUbvXGVN 8IabV/je1DhWrsJgub3eev2tHmkd5XxlrmyQ2ibNbCO+jQYnVH2ZYLuxjx82x7DI8Gd9 l6Tg6K2pty/YNlRgvZAfdT+rn4D9g54pY/wpVrBIMOVtQ/mwtI/q5zR5kU+SDbthcfCU LFSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jIcNV6Y6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a056402237200b00418c2b5bdf1si6545304eda.211.2022.03.20.03.49.36; Sun, 20 Mar 2022 03:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jIcNV6Y6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240315AbiCRTPU (ORCPT + 99 others); Fri, 18 Mar 2022 15:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233464AbiCRTPP (ORCPT ); Fri, 18 Mar 2022 15:15:15 -0400 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 238291A6343 for ; Fri, 18 Mar 2022 12:13:55 -0700 (PDT) Received: by mail-oo1-xc2e.google.com with SMTP id p10-20020a056820044a00b00320d7d4af22so11298616oou.4 for ; Fri, 18 Mar 2022 12:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZS9ok05PYKlNZu1rxfnTOBmw2CBJcOeQT2M61z+cNaM=; b=jIcNV6Y6FHF5WfQofdJeZLGkRRnKmqhlhP8GAhYV5fqxojJwo/iFsNSPY+BkpqUx7z cVnP2eLTY1pfuAozuXk/issL2JSOMhtZA+gPLzBCLnV4X2gfx+e35DiEB0llqIVUxNaw zClS82Yj+F+Z+MzHVvIlgQULs/WrocF2gkjtdtohEcYlpq/M9+X+CyeGgwengz0wUlsN iQVpXAo54MRxJIry/OK2L2T49djs92Umr4iyRknwjjs9Uw2/moDkBYWu7YyiUGTZRmw2 lCecRMLp+NgziUvdg1zC8O4201TG6JjJgSb2GpJede3OUOanB2ifRJDxvRCQ3D+3N918 q3WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZS9ok05PYKlNZu1rxfnTOBmw2CBJcOeQT2M61z+cNaM=; b=r7VKIN7LC5bldaVkiBsj6n8QdVAfxgA8oVTJfMipxOy3I19F66AV5UD/TYgEFDidLp ybTOXc/ZVcPfRisCyAhbGwBY5Jz5QWb99EAtCBchJ48KG7sYl1e5+FHXrxoR25aDecLF ujfOQHn5Ar+cRQ/K0wfnGC0rQyUIVmNfCpKxTKSctlQ0lfr3PGMFC1q9h1oQ6mBvut5G K+yWqUv+7cahh6dLlXUBcYKR+ysiQunBqqGYWmih8NJekSqcr8xfVR2boOtyWVK7pBty siylASFh1RhojYbDqlCg5YSVt1ceAlCAWAR38yA3lXi387UQICm+/RwtvOBuB4dXRua2 eeYQ== X-Gm-Message-State: AOAM532FQ0N8vTm1js7fL3iVs1X/p9xSuq5KPzC2kBuqBT26z5FYhGo4 XpK8HmBF88rZa7tl460t9BIN4aIkNHU7zeAbX3Xt/Q== X-Received: by 2002:a05:6870:58aa:b0:dd:a976:5e8f with SMTP id be42-20020a05687058aa00b000dda9765e8fmr5294282oab.112.1647630833948; Fri, 18 Mar 2022 12:13:53 -0700 (PDT) MIME-Version: 1.0 References: <20220318191012.4113266-1-daeho43@gmail.com> In-Reply-To: <20220318191012.4113266-1-daeho43@gmail.com> From: Daeho Jeong Date: Fri, 18 Mar 2022 12:13:18 -0700 Message-ID: Subject: Re: [PATCH] f2fs: make gc_urgent and gc_segment_mode sysfs node readable To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Plz, sorry, ignore this one. On Fri, Mar 18, 2022 at 12:10 PM Daeho Jeong wrote: > > From: Daeho Jeong > > Changed a way of showing values of them to use strings. > > Signed-off-by: Daeho Jeong > --- > 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 >