Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp826724pxj; Thu, 3 Jun 2021 22:12:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx99foYYkl5KBRyKFqFenbyZicWu7SZ2eU/phQ+0ZTviHlDEf5NizgP8Z4ez5dsC+5N3FQG X-Received: by 2002:a17:906:17cb:: with SMTP id u11mr2528687eje.231.1622783524405; Thu, 03 Jun 2021 22:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622783524; cv=none; d=google.com; s=arc-20160816; b=LcF/nf3yk5V2nj7DNEQ4OfMWv+8RV0mu/BtVjXVpQtouvOlPFQHSaBNwcoCrBi3XID XK7At0zKC+1walJi3uORd1sjoq/QOpqCFTwUnDgi4zDFzWedg97S+qot1V0Vqx19aEHQ I2mcWl/yTUfnb54u/ZQmXxFXTs0p+m2qUXSxDqZHw3pSz0lmmwOES1FYszP87yC6YADc 0q4iHh803PX6NBP8kwsQByJTLnrgTPmXGLqXBexoJtJcWMu6mr3hgN34XPXuEKHnkNpa OVwnbQlA17FsBCASf9Ky8UTS1FRA9W35pRL0q0abR2yEGPTbq9Jc4wnQi94gRF1Q6Fqa w8SA== 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=aEagteCok+UeITO2xTo+X3VOH/huM7ZSHieUdI1tgag=; b=cFtvzmI3uEsizuDOzgJJ597U4BixGnQFmE1u+Fm0MY6CYzYGVINgrnvJWZMLQ9qQy+ Tey+Ull/d+at5l2M2Zpgcp/EpXRvhgrSnvGOEn7zKwstxTwVh7HKcphfgyt3oy/FPTkR vc9BLCyMERvwDc37rn7WxA9u6CxTswtLCNOjdmVHZdoSTA4Fn+wVSRA+8U3+DTZc+WSs dWXDnRm3cMW4Ruxu6I3Ic0wVVUGO37NQESJrTZZTKXwfFbSKS8jIH9nuGMV6WGP5g+XR 3FaXgc5dbWwLByuSGHwCrRMQugqPuJSHfb8S0KhsZHPEmK7t7ok5B9B1ehYzbAMGIbn/ jnRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FV7Xjn8S; 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 b13si4409837ede.412.2021.06.03.22.11.39; Thu, 03 Jun 2021 22:12:04 -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=FV7Xjn8S; 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 S229751AbhFDFMg (ORCPT + 99 others); Fri, 4 Jun 2021 01:12:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:37338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhFDFMg (ORCPT ); Fri, 4 Jun 2021 01:12:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5417A61159; Fri, 4 Jun 2021 05:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622783450; bh=V08DT/rxitsvVwLGSoYGINo0EcOHL6Poon3BXcOtnjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FV7Xjn8SnhrZCOzpZnDtaSyDVdycfol0f/WiqodERQIWWXJ/BzKmxxqP2SPYRCo++ DPpQVb4mvCbcbMp8flLIhti2UFv0RcBgyVBpNzskb7dm5Ih2bZXWIztospS7+SH7Jh 0GerI02wvG2kpEgTfXozO6YmyPaSg1yH5eULAicsmKHzxYfdds/Bpnv4w7mvQqKBw4 V2SNBaN1TMIjjQJ3SwCWdUTjsQx9D311QiixXJj8eiU3Y6HKdUHhjaKJnCxiIGF/wF zHzuw/LwG9VkaEql+8bhhshDbx1fxWCXNwSTDqBF5E2ZJGUdk1B+ooQkbrCwzS6MRe vD+d+a6wHx5Xw== Date: Thu, 3 Jun 2021 22:10:48 -0700 From: Eric Biggers To: Jaegeuk Kim 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 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. 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? > +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). - Eric