All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: sysfs: use default_groups in kobj_type
@ 2021-12-28 14:46 Greg Kroah-Hartman
  2022-01-03 19:13 ` Darrick J. Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-28 14:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Darrick J. Wong, linux-xfs

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 xfs 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: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/xfs/xfs_error.c |  3 ++-
 fs/xfs/xfs_sysfs.c | 16 ++++++++++------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index 81c445e9489b..749fd18c4f32 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -213,11 +213,12 @@ static struct attribute *xfs_errortag_attrs[] = {
 	XFS_ERRORTAG_ATTR_LIST(ag_resv_fail),
 	NULL,
 };
+ATTRIBUTE_GROUPS(xfs_errortag);
 
 static struct kobj_type xfs_errortag_ktype = {
 	.release = xfs_sysfs_release,
 	.sysfs_ops = &xfs_errortag_sysfs_ops,
-	.default_attrs = xfs_errortag_attrs,
+	.default_groups = xfs_errortag_groups,
 };
 
 int
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index 8608f804388f..574b80c29fe1 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -67,11 +67,12 @@ static const struct sysfs_ops xfs_sysfs_ops = {
 static struct attribute *xfs_mp_attrs[] = {
 	NULL,
 };
+ATTRIBUTE_GROUPS(xfs_mp);
 
 struct kobj_type xfs_mp_ktype = {
 	.release = xfs_sysfs_release,
 	.sysfs_ops = &xfs_sysfs_ops,
-	.default_attrs = xfs_mp_attrs,
+	.default_groups = xfs_mp_groups,
 };
 
 #ifdef DEBUG
@@ -239,11 +240,12 @@ static struct attribute *xfs_dbg_attrs[] = {
 #endif
 	NULL,
 };
+ATTRIBUTE_GROUPS(xfs_dbg);
 
 struct kobj_type xfs_dbg_ktype = {
 	.release = xfs_sysfs_release,
 	.sysfs_ops = &xfs_sysfs_ops,
-	.default_attrs = xfs_dbg_attrs,
+	.default_groups = xfs_dbg_groups,
 };
 
 #endif /* DEBUG */
@@ -296,11 +298,12 @@ static struct attribute *xfs_stats_attrs[] = {
 	ATTR_LIST(stats_clear),
 	NULL,
 };
+ATTRIBUTE_GROUPS(xfs_stats);
 
 struct kobj_type xfs_stats_ktype = {
 	.release = xfs_sysfs_release,
 	.sysfs_ops = &xfs_sysfs_ops,
-	.default_attrs = xfs_stats_attrs,
+	.default_groups = xfs_stats_groups,
 };
 
 /* xlog */
@@ -381,11 +384,12 @@ static struct attribute *xfs_log_attrs[] = {
 	ATTR_LIST(write_grant_head),
 	NULL,
 };
+ATTRIBUTE_GROUPS(xfs_log);
 
 struct kobj_type xfs_log_ktype = {
 	.release = xfs_sysfs_release,
 	.sysfs_ops = &xfs_sysfs_ops,
-	.default_attrs = xfs_log_attrs,
+	.default_groups = xfs_log_groups,
 };
 
 /*
@@ -534,12 +538,12 @@ static struct attribute *xfs_error_attrs[] = {
 	ATTR_LIST(retry_timeout_seconds),
 	NULL,
 };
-
+ATTRIBUTE_GROUPS(xfs_error);
 
 static struct kobj_type xfs_error_cfg_ktype = {
 	.release = xfs_sysfs_release,
 	.sysfs_ops = &xfs_sysfs_ops,
-	.default_attrs = xfs_error_attrs,
+	.default_groups = xfs_error_groups,
 };
 
 static struct kobj_type xfs_error_ktype = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: sysfs: use default_groups in kobj_type
  2021-12-28 14:46 [PATCH] xfs: sysfs: use default_groups in kobj_type Greg Kroah-Hartman
@ 2022-01-03 19:13 ` Darrick J. Wong
  2022-01-04  7:01   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2022-01-03 19:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, linux-xfs

On Tue, Dec 28, 2021 at 03:46:41PM +0100, 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 xfs 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: "Darrick J. Wong" <djwong@kernel.org>
> Cc: linux-xfs@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Looks good to me.  Shall I take this through the xfs tree?

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_error.c |  3 ++-
>  fs/xfs/xfs_sysfs.c | 16 ++++++++++------
>  2 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
> index 81c445e9489b..749fd18c4f32 100644
> --- a/fs/xfs/xfs_error.c
> +++ b/fs/xfs/xfs_error.c
> @@ -213,11 +213,12 @@ static struct attribute *xfs_errortag_attrs[] = {
>  	XFS_ERRORTAG_ATTR_LIST(ag_resv_fail),
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(xfs_errortag);
>  
>  static struct kobj_type xfs_errortag_ktype = {
>  	.release = xfs_sysfs_release,
>  	.sysfs_ops = &xfs_errortag_sysfs_ops,
> -	.default_attrs = xfs_errortag_attrs,
> +	.default_groups = xfs_errortag_groups,
>  };
>  
>  int
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index 8608f804388f..574b80c29fe1 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -67,11 +67,12 @@ static const struct sysfs_ops xfs_sysfs_ops = {
>  static struct attribute *xfs_mp_attrs[] = {
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(xfs_mp);
>  
>  struct kobj_type xfs_mp_ktype = {
>  	.release = xfs_sysfs_release,
>  	.sysfs_ops = &xfs_sysfs_ops,
> -	.default_attrs = xfs_mp_attrs,
> +	.default_groups = xfs_mp_groups,
>  };
>  
>  #ifdef DEBUG
> @@ -239,11 +240,12 @@ static struct attribute *xfs_dbg_attrs[] = {
>  #endif
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(xfs_dbg);
>  
>  struct kobj_type xfs_dbg_ktype = {
>  	.release = xfs_sysfs_release,
>  	.sysfs_ops = &xfs_sysfs_ops,
> -	.default_attrs = xfs_dbg_attrs,
> +	.default_groups = xfs_dbg_groups,
>  };
>  
>  #endif /* DEBUG */
> @@ -296,11 +298,12 @@ static struct attribute *xfs_stats_attrs[] = {
>  	ATTR_LIST(stats_clear),
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(xfs_stats);
>  
>  struct kobj_type xfs_stats_ktype = {
>  	.release = xfs_sysfs_release,
>  	.sysfs_ops = &xfs_sysfs_ops,
> -	.default_attrs = xfs_stats_attrs,
> +	.default_groups = xfs_stats_groups,
>  };
>  
>  /* xlog */
> @@ -381,11 +384,12 @@ static struct attribute *xfs_log_attrs[] = {
>  	ATTR_LIST(write_grant_head),
>  	NULL,
>  };
> +ATTRIBUTE_GROUPS(xfs_log);
>  
>  struct kobj_type xfs_log_ktype = {
>  	.release = xfs_sysfs_release,
>  	.sysfs_ops = &xfs_sysfs_ops,
> -	.default_attrs = xfs_log_attrs,
> +	.default_groups = xfs_log_groups,
>  };
>  
>  /*
> @@ -534,12 +538,12 @@ static struct attribute *xfs_error_attrs[] = {
>  	ATTR_LIST(retry_timeout_seconds),
>  	NULL,
>  };
> -
> +ATTRIBUTE_GROUPS(xfs_error);
>  
>  static struct kobj_type xfs_error_cfg_ktype = {
>  	.release = xfs_sysfs_release,
>  	.sysfs_ops = &xfs_sysfs_ops,
> -	.default_attrs = xfs_error_attrs,
> +	.default_groups = xfs_error_groups,
>  };
>  
>  static struct kobj_type xfs_error_ktype = {
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: sysfs: use default_groups in kobj_type
  2022-01-03 19:13 ` Darrick J. Wong
@ 2022-01-04  7:01   ` Greg Kroah-Hartman
  2022-01-04 18:05     ` Darrick J. Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-04  7:01 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-kernel, linux-xfs

On Mon, Jan 03, 2022 at 11:13:21AM -0800, Darrick J. Wong wrote:
> On Tue, Dec 28, 2021 at 03:46:41PM +0100, 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 xfs 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: "Darrick J. Wong" <djwong@kernel.org>
> > Cc: linux-xfs@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Looks good to me.  Shall I take this through the xfs tree?
> 
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

Please feel free to.  Or if you do not want to, I can take it through my
trees, which ever is easier for you, just let me know.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: sysfs: use default_groups in kobj_type
  2022-01-04  7:01   ` Greg Kroah-Hartman
@ 2022-01-04 18:05     ` Darrick J. Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2022-01-04 18:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, linux-xfs

On Tue, Jan 04, 2022 at 08:01:26AM +0100, Greg Kroah-Hartman wrote:
> On Mon, Jan 03, 2022 at 11:13:21AM -0800, Darrick J. Wong wrote:
> > On Tue, Dec 28, 2021 at 03:46:41PM +0100, 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 xfs 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: "Darrick J. Wong" <djwong@kernel.org>
> > > Cc: linux-xfs@vger.kernel.org
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > Looks good to me.  Shall I take this through the xfs tree?
> > 
> > Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> 
> Please feel free to.  Or if you do not want to, I can take it through my
> trees, which ever is easier for you, just let me know.

I'll put it in my tree, thanks for freshening the sysfs code! :)

--D

> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-04 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 14:46 [PATCH] xfs: sysfs: use default_groups in kobj_type Greg Kroah-Hartman
2022-01-03 19:13 ` Darrick J. Wong
2022-01-04  7:01   ` Greg Kroah-Hartman
2022-01-04 18:05     ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.