Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp839532pxj; Thu, 3 Jun 2021 22:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/DHTVujYA1rWjb5mof9BJWfiSR8LOx+EjtcCynWU3VHe9zzRpDkTdXG4nhPZn3WHjkVYl X-Received: by 2002:aa7:c654:: with SMTP id z20mr2934206edr.26.1622785085843; Thu, 03 Jun 2021 22:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622785085; cv=none; d=google.com; s=arc-20160816; b=zTyfcUcQaY2AJcDnGttTouWjNOddsVVjX/4Ydluj2w1gbkrr08He+4tMhjeKumdMUM xGP0f1FGduoFBZbQSCku59WdxQxjtAd1x0SuAWpKgh4cfaOQ5FjYws2nDFHM8ci7v7QS UVA+68fIbbe5U/6WtWKC0EsuWhAJGuAOiLCQNGf68Ocd8y8zHqKGS0u9clSdIyY380HS LuM831Ohe5cRH31XCR9bQIvoJlbGXuh7Dy3c0yaBBC+KhreO4NneVRKfc+SC4I4hdSFt X3cwHEVmE56ckvVt3If47GiKtyu7lCC4wtfxiRZSHUqaZr710JuQT/SujH4Ey9jHW732 X+6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NAKh8gI0DKT81f8Y1Q9+GBNfI7kyT6Wd/a0ioamLeI0=; b=ZdFyYES8IXkboL6JYcIvC/n/P92qbvSKTsvIHaRQbxPYf4u/bTGiIbhdI1Biy/xK2H Vw2O64/fKaw1RaBYcnHg/pJScXyQBwpdb438Uq0nRKkO41abQaEyBMaYIk56pE7dRbMP uAAbvNC6gkue4X3pHaMTSI84c55l5+aDaXADnjsC7KnqLjKLd8AmaMf5AVgBV3dqGKh9 67VmWUYCbSNhjrSAGkFqV9GaS6GiNzL2QsyXYSHQRs5y/FuSHwyGSBRFqAZiu8HWLhK4 TpG9zi4bR8DrdyBNOBA7gPSOdRBu3wbmLD1eH0z3D/f6AW++6O9gNz6l1sr83bs8124V RX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bzrVJvrp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si3955656edq.336.2021.06.03.22.37.35; Thu, 03 Jun 2021 22:38:05 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bzrVJvrp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbhFDFgg (ORCPT + 99 others); Fri, 4 Jun 2021 01:36:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:40318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbhFDFgg (ORCPT ); Fri, 4 Jun 2021 01:36:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C5686140F; Fri, 4 Jun 2021 05:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622784890; bh=CZRsTARUFf+bfqnIsqTxlZDBGyP7XKDxDCRAdZ6HnyM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bzrVJvrpCMIDOL0flT0eW++HPr+d/QVBaiNcCRghhb5/iIKz+cc7VswXUXXUdWHqx 5a9WZ6C9mb/xXe/ZqI0cYwVuE5LiS+fxSiK8ZU7izH1tRjbkwPdfWEzxupFfwsHLT0 l1a3PXxAzjOGbnuiY/6GyECIhqvxwGzd2PjyQ25l1K7MZJh8pD9FHUsRwy+MYw1ZC4 eCzYW1rtX5nACkrJGgPe1JB8Au72B5OgB+L/1BZYhwHobui9WgNxhjH1AIaD0OtvLV 7WyaJ6cz9qEkAEVH9Y/MY+elf2gexdeTmwR5T5BOVEgYxdrxXMmwIASMtJHAB40SUh eMuN+VeD6Oo0Q== Date: Thu, 3 Jun 2021 22:34:48 -0700 From: Jaegeuk Kim To: Eric Biggers Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH v2] f2fs: clean up /sys/fs/f2fs//features Message-ID: References: <20210603220834.1949988-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/03, Eric Biggers wrote: > On Thu, Jun 03, 2021 at 09:42:08PM -0700, Jaegeuk Kim wrote: > > enum feat_id { > > FEAT_CRYPTO = 0, > > FEAT_BLKZONED, > > @@ -587,6 +601,7 @@ enum feat_id { > > FEAT_RO, > > FEAT_TEST_DUMMY_ENCRYPTION_V2, > > FEAT_ENCRYPTED_CASEFOLD, > > + FEAT_PIN_FILE, > > }; > > > > static ssize_t f2fs_feature_show(struct f2fs_attr *a, > > @@ -610,6 +625,7 @@ static ssize_t f2fs_feature_show(struct f2fs_attr *a, > > case FEAT_RO: > > case FEAT_TEST_DUMMY_ENCRYPTION_V2: > > case FEAT_ENCRYPTED_CASEFOLD: > > + case FEAT_PIN_FILE: > > return sprintf(buf, "supported\n"); > > } > > return 0; > > There's no need for the feat_id enum to exist. If f2fs_feature_show() just > always printed "supported\n", it will do the right thing. Done. > > Also, adding pin_file probably should be a separate patch. That seems to be a > bug fix, as pin_file was mistakenly added to the per-sb feature list instead of > to the kernel feature list? Done. > > > +static ssize_t f2fs_sb_feature_show(struct f2fs_attr *a, > > + struct f2fs_sb_info *sbi, char *buf) > > +{ > > + if (F2FS_MATCH_FEATURE(sbi, a->id)) > > + return sprintf(buf, "supported\n"); > > + return sprintf(buf, "unsupported\n"); > > +} > > This can just use F2FS_HAS_FEATURE(), provided that encrypted_casefold isn't > included here, which it shouldn't be (as discussed elsewhere). I know, but I think it'd be good to sync with kernel feature. > > - Eric