From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Cc: Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Miguel Ojeda <ojeda@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
ocfs2-devel@oss.oracle.com
Subject: Re: [PATCH] ocfs2: cluster: use default_groups in kobj_type
Date: Thu, 6 Jan 2022 19:29:24 +0800 [thread overview]
Message-ID: <0dd319cf-8e2e-e378-368f-e419d5f9b6a6@linux.alibaba.com> (raw)
In-Reply-To: <20220106102028.3345634-1-gregkh@linuxfoundation.org>
Reviewed-and-Tested-by: Joseph Qi <joseph.qi@linux.alibaba.com>
On 1/6/22 6:20 PM, Greg Kroah-Hartman wrote:
> There are currently 2 ways to create a set of sysfs files for a
> kobj_type, through the default_attrs field, and the default_groups
> field. Move the ocfs2 cluster sysfs code to use default_groups field
> which has been the preferred way since aa30f47cf666 ("kobject: Add
> support for default attribute groups to kobj_type") so that we can soon
> get rid of the obsolete default_attrs field.
>
> Cc: Mark Fasheh <mark@fasheh.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Miguel Ojeda <ojeda@kernel.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: ocfs2-devel@oss.oracle.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> fs/ocfs2/cluster/masklog.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
> index 810d32815593..563881ddbf00 100644
> --- a/fs/ocfs2/cluster/masklog.c
> +++ b/fs/ocfs2/cluster/masklog.c
> @@ -120,7 +120,8 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
> define_mask(KTHREAD),
> };
>
> -static struct attribute *mlog_attr_ptrs[MLOG_MAX_BITS] = {NULL, };
> +static struct attribute *mlog_default_attrs[MLOG_MAX_BITS] = {NULL, };
> +ATTRIBUTE_GROUPS(mlog_default);
>
> static ssize_t mlog_show(struct kobject *obj, struct attribute *attr,
> char *buf)
> @@ -144,8 +145,8 @@ static const struct sysfs_ops mlog_attr_ops = {
> };
>
> static struct kobj_type mlog_ktype = {
> - .default_attrs = mlog_attr_ptrs,
> - .sysfs_ops = &mlog_attr_ops,
> + .default_groups = mlog_default_groups,
> + .sysfs_ops = &mlog_attr_ops,
> };
>
> static struct kset mlog_kset = {
> @@ -157,10 +158,10 @@ int mlog_sys_init(struct kset *o2cb_kset)
> int i = 0;
>
> while (mlog_attrs[i].attr.mode) {
> - mlog_attr_ptrs[i] = &mlog_attrs[i].attr;
> + mlog_default_attrs[i] = &mlog_attrs[i].attr;
> i++;
> }
> - mlog_attr_ptrs[i] = NULL;
> + mlog_default_attrs[i] = NULL;
>
> kobject_set_name(&mlog_kset.kobj, "logmask");
> mlog_kset.kobj.kset = o2cb_kset;
prev parent reply other threads:[~2022-01-06 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-06 10:20 Greg Kroah-Hartman
2022-01-06 11:29 ` Joseph Qi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0dd319cf-8e2e-e378-368f-e419d5f9b6a6@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=masahiroy@kernel.org \
--cc=ocfs2-devel@oss.oracle.com \
--cc=ojeda@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome