Message ID | 20230209-kobj_type-f2fs-v1-1-b6feedbdd4a8@weissschuh.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp100772wrn; Wed, 8 Feb 2023 19:29:36 -0800 (PST) X-Google-Smtp-Source: AK7set9t0MUCXCtEmKozpUL7HZsf3Lc3+WCjnQlY48dGML1bHsYhUbzgUyk1POmSlMG9Qbnd287b X-Received: by 2002:a17:90a:a66:b0:231:2571:d035 with SMTP id o93-20020a17090a0a6600b002312571d035mr1986822pjo.4.1675913375753; Wed, 08 Feb 2023 19:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675913375; cv=none; d=google.com; s=arc-20160816; b=dy1KV1Ka3iiuLf+R8kMiPo1c0NCS9nBP8ZMBR65GfVc8isLM+gcMEuBBx/cCxn7h2f O+Ad28KIgTcB3AWgMsLiQU1S2dkNWZQThxcTozpBgfMA2PPRgIiARFbHmAOvbkl/2F1k VrsxTILp9F506r9yv43x4jNkBkc9s+PYNWvz6jA+u9lLJ4xmWQzgL+W6foE11QnpGKPy x9c+PY7yl9guXfpUPvC5AB8uYLQFX7HMAtLIv0sQPhOZSzeExlwu1/r24iUKWbHUGMZ1 Aag9IjvBdvT1bamppe3g8B3QxbeVOB57C56M7rX7UBDdL+KPLb0iicQlWq9j/PqKroi3 x32g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from; bh=3PDIZyYb+5LLhaFUqsvYX1N3H9Ka1BZC1OmItwxznB4=; b=OqqkTgwhTFNOaQj7Pk7uiBE/cNk0sDg+BxAkCXPEJCXBhXhJBcG+zNRZjCDrch7S6Y Scj9whhF1D6ZzLKQaYnlgYL4BEmgpwHzBfvkfpDR+L5KQhyB04r/eW8FlPt/3c8PrlpW LfpJGxlEZATaOmmMMFxLhO/NHwd0MFPYIfPnpFEUHYMM93qyaKJqLJ4aV9hp2tUEyLyv sVwWm77su9CgkpzKPddthLm5uBNG13vUOuBaJRHzx1y99YeIRloJTjz+aqfl+1aJky/I sG0XmZNYTNIielQU2ckU0PTzBogAJlK9LUP1x4i5KXMlcNhgu2rIYVO1JtWSSmGlRl6c HR4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=FmqVtcQM; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a17090a694400b002312292a671si2202997pjm.17.2023.02.08.19.29.17; Wed, 08 Feb 2023 19:29:35 -0800 (PST) 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=fail header.i=@weissschuh.net header.s=mail header.b=FmqVtcQM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232348AbjBIDVF (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Wed, 8 Feb 2023 22:21:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbjBIDU4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 8 Feb 2023 22:20:56 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55640658D for <linux-kernel@vger.kernel.org>; Wed, 8 Feb 2023 19:20:16 -0800 (PST) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1675912814; bh=0ax1L+4wlH+3bsB/7eEn2YOweom015kqtn2sv4C2TLM=; h=From:Date:Subject:To:Cc:From; b=FmqVtcQMfIPfadTCbIb6fQaMYIPvH7vQ8bGmgzgE48D5pOefvT8fWpZQQmsMrDrF9 fOJ4kowhcbW5ytiOuOmPFxEMntnr7Tb/W7qvlGpeerY56geyqtXb5gahcF30WoQowB mIzTTORMQQYsv37hlUAcFY3Ur8Pj4Qi76JlfPcPk= Date: Thu, 09 Feb 2023 03:20:10 +0000 Subject: [PATCH] f2fs: make kobj_type structures constant MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230209-kobj_type-f2fs-v1-1-b6feedbdd4a8@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAGlm5GMC/x2NQQrCQAwAv1JyNrDGXtqviMhmzdrUsi0bFaX07 6YeZ2CYFUyqikHfrFDlraZzcTgeGkhDLHdBvTkDBToFCh0+Zh6vz+8imCkbctx9armjAB5xNEG usaTBs/KaJpdLlayf/+V82bYf4kgpr3UAAAA= To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org> Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1675912812; l=2105; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=0ax1L+4wlH+3bsB/7eEn2YOweom015kqtn2sv4C2TLM=; b=kIRzSTrKvek4pySmNk1lSuXeegxwku6qFmFpJjx7qPcDmSyr1HrZc7v/iT/FDL9a3zQH3ynhi z00ICnBe17YAoHuKe6JJhWcCvt440/jSRgeJiJJdyR/TAYIYMrybH8a X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757322543596433927?= X-GMAIL-MSGID: =?utf-8?q?1757322543596433927?= |
Series |
f2fs: make kobj_type structures constant
|
|
Commit Message
Thomas Weißschuh
Feb. 9, 2023, 3:20 a.m. UTC
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.
Take advantage of this to constify the structure definitions to prevent
modification at runtime.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
fs/f2fs/sysfs.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
base-commit: 0983f6bf2bfc0789b51ddf7315f644ff4da50acb
change-id: 20230209-kobj_type-f2fs-ba2302c4b920
Best regards,
Comments
Hello: This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <jaegeuk@kernel.org>: On Thu, 09 Feb 2023 03:20:10 +0000 you wrote: > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > the driver core allows the usage of const struct kobj_type. > > Take advantage of this to constify the structure definitions to prevent > modification at runtime. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > [...] Here is the summary with links: - [f2fs-dev] f2fs: make kobj_type structures constant https://git.kernel.org/jaegeuk/f2fs/c/663bb23cc1ac You are awesome, thank you!
On 2023/2/9 11:20, Thomas Weißschuh wrote: > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > the driver core allows the usage of const struct kobj_type. > > Take advantage of this to constify the structure definitions to prevent > modification at runtime. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
On 02/13, Chao Yu wrote: > On 2023/2/9 11:20, Thomas Weißschuh wrote: > > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > > the driver core allows the usage of const struct kobj_type. > > > > Take advantage of this to constify the structure definitions to prevent > > modification at runtime. > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > Reviewed-by: Chao Yu <chao@kernel.org> Hi Chao, Note that, next time, I won't apply/modify any patches merged in -dev, unless it has a problem. Thanks, > > Thanks,
On 2023/2/14 1:51, Jaegeuk Kim wrote: > On 02/13, Chao Yu wrote: >> On 2023/2/9 11:20, Thomas Weißschuh wrote: >>> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") >>> the driver core allows the usage of const struct kobj_type. >>> >>> Take advantage of this to constify the structure definitions to prevent >>> modification at runtime. >>> >>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> >> >> Reviewed-by: Chao Yu <chao@kernel.org> > > Hi Chao, > > Note that, next time, I won't apply/modify any patches merged in -dev, > unless it has a problem. Hi Jaegeuk, Oh, any particular reason, to avoid unneeded commit id change when the time is close to merge window? Is there any period of grace before merging patches from dev-test branch into dev branch? Maybe a week is reasonable? so I may have time to catch up in time. Thanks, > > Thanks, > >> >> Thanks,
On 02/14, Chao Yu wrote: > On 2023/2/14 1:51, Jaegeuk Kim wrote: > > On 02/13, Chao Yu wrote: > > > On 2023/2/9 11:20, Thomas Weißschuh wrote: > > > > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > > > > the driver core allows the usage of const struct kobj_type. > > > > > > > > Take advantage of this to constify the structure definitions to prevent > > > > modification at runtime. > > > > > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > > > > > Reviewed-by: Chao Yu <chao@kernel.org> > > > > Hi Chao, > > > > Note that, next time, I won't apply/modify any patches merged in -dev, > > unless it has a problem. > > Hi Jaegeuk, > > Oh, any particular reason, to avoid unneeded commit id change when the time is > close to merge window? Hi Chao, I'm trying to avoid breaking the -next branch. > > Is there any period of grace before merging patches from dev-test branch into dev > branch? Maybe a week is reasonable? so I may have time to catch up in time. No rule, but I'm trying to wait for several days while running my local tests. If the patch looks okay, sometimes I'll queue it right away. Thanks, > > Thanks, > > > > > Thanks, > > > > > > > > Thanks,
On 2023/2/15 2:07, Jaegeuk Kim wrote: > On 02/14, Chao Yu wrote: >> On 2023/2/14 1:51, Jaegeuk Kim wrote: >>> On 02/13, Chao Yu wrote: >>>> On 2023/2/9 11:20, Thomas Weißschuh wrote: >>>>> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") >>>>> the driver core allows the usage of const struct kobj_type. >>>>> >>>>> Take advantage of this to constify the structure definitions to prevent >>>>> modification at runtime. >>>>> >>>>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> >>>> >>>> Reviewed-by: Chao Yu <chao@kernel.org> >>> >>> Hi Chao, >>> >>> Note that, next time, I won't apply/modify any patches merged in -dev, >>> unless it has a problem. >> >> Hi Jaegeuk, >> >> Oh, any particular reason, to avoid unneeded commit id change when the time is >> close to merge window? > > Hi Chao, > > I'm trying to avoid breaking the -next branch. Jaegeuk, so why do we need to avoid breaking -next branch? I didn't get it. :-( > >> >> Is there any period of grace before merging patches from dev-test branch into dev >> branch? Maybe a week is reasonable? so I may have time to catch up in time. > > No rule, but I'm trying to wait for several days while running my local tests. > If the patch looks okay, sometimes I'll queue it right away. Sure, not problem. Thanks, > > Thanks, > >> >> Thanks, >> >>> >>> Thanks, >>> >>>> >>>> Thanks,
On 02/15, Chao Yu wrote: > On 2023/2/15 2:07, Jaegeuk Kim wrote: > > On 02/14, Chao Yu wrote: > > > On 2023/2/14 1:51, Jaegeuk Kim wrote: > > > > On 02/13, Chao Yu wrote: > > > > > On 2023/2/9 11:20, Thomas Weißschuh wrote: > > > > > > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > > > > > > the driver core allows the usage of const struct kobj_type. > > > > > > > > > > > > Take advantage of this to constify the structure definitions to prevent > > > > > > modification at runtime. > > > > > > > > > > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > > > > > > > > > > Reviewed-by: Chao Yu <chao@kernel.org> > > > > > > > > Hi Chao, > > > > > > > > Note that, next time, I won't apply/modify any patches merged in -dev, > > > > unless it has a problem. > > > > > > Hi Jaegeuk, > > > > > > Oh, any particular reason, to avoid unneeded commit id change when the time is > > > close to merge window? > > > > Hi Chao, > > > > I'm trying to avoid breaking the -next branch. > > Jaegeuk, so why do we need to avoid breaking -next branch? I didn't get it. :-( That's not for linux-next, but my -next work. > > > > > > > > > Is there any period of grace before merging patches from dev-test branch into dev > > > branch? Maybe a week is reasonable? so I may have time to catch up in time. > > > > No rule, but I'm trying to wait for several days while running my local tests. > > If the patch looks okay, sometimes I'll queue it right away. > > Sure, not problem. > > Thanks, > > > > > Thanks, > > > > > > > > Thanks, > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > Thanks,
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 83a366f3ee80..43f1ff1b92ba 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -1129,13 +1129,13 @@ static const struct sysfs_ops f2fs_attr_ops = { .store = f2fs_attr_store, }; -static struct kobj_type f2fs_sb_ktype = { +static const struct kobj_type f2fs_sb_ktype = { .default_groups = f2fs_groups, .sysfs_ops = &f2fs_attr_ops, .release = f2fs_sb_release, }; -static struct kobj_type f2fs_ktype = { +static const struct kobj_type f2fs_ktype = { .sysfs_ops = &f2fs_attr_ops, }; @@ -1143,7 +1143,7 @@ static struct kset f2fs_kset = { .kobj = {.ktype = &f2fs_ktype}, }; -static struct kobj_type f2fs_feat_ktype = { +static const struct kobj_type f2fs_feat_ktype = { .default_groups = f2fs_feat_groups, .sysfs_ops = &f2fs_attr_ops, }; @@ -1184,7 +1184,7 @@ static const struct sysfs_ops f2fs_stat_attr_ops = { .store = f2fs_stat_attr_store, }; -static struct kobj_type f2fs_stat_ktype = { +static const struct kobj_type f2fs_stat_ktype = { .default_groups = f2fs_stat_groups, .sysfs_ops = &f2fs_stat_attr_ops, .release = f2fs_stat_kobj_release, @@ -1211,7 +1211,7 @@ static const struct sysfs_ops f2fs_feature_list_attr_ops = { .show = f2fs_sb_feat_attr_show, }; -static struct kobj_type f2fs_feature_list_ktype = { +static const struct kobj_type f2fs_feature_list_ktype = { .default_groups = f2fs_sb_feat_groups, .sysfs_ops = &f2fs_feature_list_attr_ops, .release = f2fs_feature_list_kobj_release,