Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp939985pxb; Wed, 3 Mar 2021 21:51:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzFqE9S12poXRAwIInGbsTmF/v6EnLBc5UM8pmwmXJhgzK+7qlZIqtGyPfUJ8uysXPRMR+ X-Received: by 2002:a50:b5e4:: with SMTP id a91mr2565030ede.173.1614837102843; Wed, 03 Mar 2021 21:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837102; cv=none; d=google.com; s=arc-20160816; b=uvUbGgr7qtIuFDj+G9Hsx6rrD6F1zxTsfkiUOnH/JEL3KmLmpHnYHWh0FEULDdgAnY lJTLo1kraHK3WZbH8G76dmZH9EgAsv76+R1AF+z/Tverk3O40+1QoDOjiEVkJi38COeL JzmU94+HQ8mrCZmpOSifCX5nHt1Sb+D+9i7YdqdaUxOqjMout4wXbcHr8m6gWkCzZOcb vRW2PrmmZNNEfmxVahtdn7a64lHiZXBpmzy7WJPvw8UhdyEu3Ri5SA0JqnSzG5jJrShz T1EBSxpTjaDCVuwP6JWXGC0t+heTtztPHxxgh1ASH5sSsnkwDkqiGJXGCACzfZookInj 3uJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=0sLQemdTtYEVWSXHSCHtY8Xkz+Xu9nQuH7n+gjbWuZo=; b=M5S1JDwFKuj6YpbcieBhAQgjnV9cjbeI3x1ox2c61lbMUr/B5+f2P82gFzmlm32jpM hoWrDl8cGlzQGpVl8hwQCeun5R4q28FV4SnqbrGMexKNGAZxYsl//x8xN943UxKCWb0J hkWgvbPFnENagNG+feuyuw0FIjWH/Et0e6hYgMdQOiWa0L3f5G4mf9TXlXphl6DmbowD xkKYDCXclV0AEsB5B3+0DUu8x/Fjm2Td9pUZub60TvXVtNnKIJS8NRqvx3VKZqRFgyyp llUaqRXEbsS8lMMv6U4Ls6wBJUgYeWbRCsqXtNGS8F+n0LatqE/MG0woA5op8nDeexlC AOLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si4305287eds.403.2021.03.03.21.51.21; Wed, 03 Mar 2021 21:51:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1836416AbhCBHCF (ORCPT + 99 others); Tue, 2 Mar 2021 02:02:05 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:13828 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835859AbhCBGMH (ORCPT ); Tue, 2 Mar 2021 01:12:07 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DqRY56MKpz7sDF; Tue, 2 Mar 2021 14:09:29 +0800 (CST) Received: from [10.136.110.154] (10.136.110.154) by smtp.huawei.com (10.3.19.211) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 2 Mar 2021 14:11:07 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: expose # of overprivision segments To: Jaegeuk Kim , , , References: <20210302054233.3886681-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: <920469a9-45d3-68e3-1f8d-a436bdd60cfe@huawei.com> Date: Tue, 2 Mar 2021 14:11:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20210302054233.3886681-1-jaegeuk@kernel.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.110.154] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/2 13:42, Jaegeuk Kim wrote: > This is useful when checking conditions during checkpoint=disable in Android. This sysfs entry is readonly, how about putting this at /sys/fs/f2fs//stat/? > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/sysfs.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c > index e38a7f6921dd..254b6fa17406 100644 > --- a/fs/f2fs/sysfs.c > +++ b/fs/f2fs/sysfs.c > @@ -91,6 +91,13 @@ static ssize_t free_segments_show(struct f2fs_attr *a, > (unsigned long long)(free_segments(sbi))); > } > > +static ssize_t ovp_segments_show(struct f2fs_attr *a, > + struct f2fs_sb_info *sbi, char *buf) > +{ > + return sprintf(buf, "%llu\n", > + (unsigned long long)(overprovision_segments(sbi))); > +} > + > static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a, > struct f2fs_sb_info *sbi, char *buf) > { > @@ -629,6 +636,7 @@ F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, node_io_flag, node_io_flag); > F2FS_RW_ATTR(CPRC_INFO, ckpt_req_control, ckpt_thread_ioprio, ckpt_thread_ioprio); > F2FS_GENERAL_RO_ATTR(dirty_segments); > F2FS_GENERAL_RO_ATTR(free_segments); > +F2FS_GENERAL_RO_ATTR(ovp_segments); Missed to add document entry in Documentation/ABI/testing/sysfs-fs-f2fs? Thanks, > F2FS_GENERAL_RO_ATTR(lifetime_write_kbytes); > F2FS_GENERAL_RO_ATTR(features); > F2FS_GENERAL_RO_ATTR(current_reserved_blocks); >