Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp626893pxp; Sat, 19 Mar 2022 12:04:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2NcKpnwBzCrKuhmvQKJJ633Yz7wgY7O2j5dnVoUym93Mk8W6z4LdBK1YzihYywAibCcAl X-Received: by 2002:a17:906:a1c2:b0:6d6:d54d:4fb1 with SMTP id bx2-20020a170906a1c200b006d6d54d4fb1mr14679538ejb.490.1647716640964; Sat, 19 Mar 2022 12:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647716640; cv=none; d=google.com; s=arc-20160816; b=nT3etVIRubniQ5Gsga/meTOABLJT+wFRIbxAb6/Q63eLhZ1Ip+kyJaVPKpnZ3ZwK5h Xh1DB+tCkCBEuc5Xl487pJw+9aT9pGpOUq/umsmHsK2MsEtcXMlLvyb0W5WbUA2HzziT yub0j4A/tESidbb2lg3dt3pLX2azhv2sxIsH1XQNh5NClD415A03ulv4Gs1hGfYZe8CR zF9HUtjTWa2c4xb4LWyJ8W1nk3WI2Uwm8+ydbHdBpoCFYsKNwVapfZA2sjCYc8lis65p NrVWyIOY2bcziiJLuyD/u+5efbOqsMK/wU1ME+23lV6qy0C4LFcW2tY7aiApnt8scXVE TkNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IzmP5X2K1BS5f1i59g5bK2cyyZHxNOqC8TIBy5CRON4=; b=ssq3dXdSusMtu8NgsJFlhm1pVE0nokE/YDhsIM6k5Xkw8aC3kF+iE4KUVhRPnqt3nt VsehMbUgHFBbjMXevfBFsP1twiayT3zXG1HpIEhPTyzyguGgiM6GrfXjs4DS/XwSs/rl GB0Bve0C8hrgHCaY0WImBCX1zITlcNZBwxDXghcD5QrXBhUOXLA6b1WQZADo5JrwYddU Sa8R+RilnyQHkRCjly+2s4ah29Oon8hLBGRK9XbQHKC2UMUg93rI0kdWbiCVzt/e24lU 5Vq2iX5LKZIzL2MIdgoVF48XboyAHUndGzIrUUENrdDtndWo4rpUG7pcOo+9AaSd45ut UZFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TL+wPZUO; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a50998b000000b00418c2b5bd86si4596573edb.104.2022.03.19.12.03.35; Sat, 19 Mar 2022 12:04:00 -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=@gmail.com header.s=20210112 header.b=TL+wPZUO; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239747AbiCRTLk (ORCPT + 99 others); Fri, 18 Mar 2022 15:11:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233464AbiCRTLh (ORCPT ); Fri, 18 Mar 2022 15:11:37 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 975F71903C4 for ; Fri, 18 Mar 2022 12:10:17 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id g19so10237171pfc.9 for ; Fri, 18 Mar 2022 12:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IzmP5X2K1BS5f1i59g5bK2cyyZHxNOqC8TIBy5CRON4=; b=TL+wPZUOExCQFV7t11tRDwapOCTIkSSbQ3UsI0+BOkK6x2ELC2+xCHZOx1E+I2zUwk 5NpYAK+IF8/D0YZD5qRYWVHtLBUFliQg23d4ZDDtJFNfQGHFB/xn+rJivIZ011tNWvXn ml7a3xOpzyL0ARzIjGrzfZdybZDks/V/ioMucV2XagHr5dimIH4klZ1R2nLiFrawhnKY RY9np4SEMrkH6ABb/FjkYc/+HmbXgCxfp7QfLX44cUlTJ374NW1SAgq2Iseqw60HPFPJ 2B0mFA6XJk9fLzR5/hjmjeYsXHrKlaUnpS3cK0VxeuZSNY4eTdYUDdmqZPOb+aaEhjuh 7nOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IzmP5X2K1BS5f1i59g5bK2cyyZHxNOqC8TIBy5CRON4=; b=0v8eQ/MbQ9DnII4XaGmhkCS4Q9vLPLOJGmlC9TwXGISgEBjmPMkx4d89I5TlqxBNHp uA7msrE/9R0193Znqved3eBkWt/EypbnBJpQGDUbZ3Nro1zpYo/XAe27V+4qejj9MRCW qUmLfmmKQcPOQu0WmHwLKzEDNyzZSjs4MjKChduN7Ms15CyA5mGQZm6e96Tu+8mVJpt0 W7Q7nGqUDUOTJXwQe2nQ9Ab83DRBtnNZ5OGYFSfYFv3rVcQ4sZsmbhWJ5tAbOvUtdPaQ km/0oG869wru2eCp13Sor2vzb/bzRR/siFHsVqfDKGK5KEsQucXyX6vMP9rM6s4o2gEq lCpg== X-Gm-Message-State: AOAM5335K9/XCaeAesRPiJWrGWXvWhGP//kLpULLcu3HVFiCEVz3XYO0 S5ZYCaRQkAaPdMsAYn55iA1u+fSrLZM= X-Received: by 2002:a62:8308:0:b0:4fa:7bcd:d0e6 with SMTP id h8-20020a628308000000b004fa7bcdd0e6mr1672788pfe.35.1647630616872; Fri, 18 Mar 2022 12:10:16 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:a64c:198c:4e57:caeb]) by smtp.gmail.com with ESMTPSA id 16-20020a17090a199000b001bf4b1b268bsm8523113pji.44.2022.03.18.12.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Mar 2022 12:10:16 -0700 (PDT) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH] f2fs: make gc_urgent and gc_segment_mode sysfs node readable Date: Fri, 18 Mar 2022 12:10:12 -0700 Message-Id: <20220318191012.4113266-1-daeho43@gmail.com> X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 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