Skip to content

Commit 86439fa

Browse files
gregkhamschuma-ntap
authored andcommitted
SUNRPC: use default_groups in kobj_type
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 sunrpc sysfs code to use default_groups field which has been the preferred way since aa30f47 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Chuck Lever <chuck.lever@oracle.com> Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 01f3424 commit 86439fa

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

net/sunrpc/sysfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ static struct attribute *rpc_sysfs_xprt_attrs[] = {
422422
&rpc_sysfs_xprt_change_state.attr,
423423
NULL,
424424
};
425+
ATTRIBUTE_GROUPS(rpc_sysfs_xprt);
425426

426427
static struct kobj_attribute rpc_sysfs_xprt_switch_info =
427428
__ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL);
@@ -430,6 +431,7 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
430431
&rpc_sysfs_xprt_switch_info.attr,
431432
NULL,
432433
};
434+
ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
433435

434436
static struct kobj_type rpc_sysfs_client_type = {
435437
.release = rpc_sysfs_client_release,
@@ -439,14 +441,14 @@ static struct kobj_type rpc_sysfs_client_type = {
439441

440442
static struct kobj_type rpc_sysfs_xprt_switch_type = {
441443
.release = rpc_sysfs_xprt_switch_release,
442-
.default_attrs = rpc_sysfs_xprt_switch_attrs,
444+
.default_groups = rpc_sysfs_xprt_switch_groups,
443445
.sysfs_ops = &kobj_sysfs_ops,
444446
.namespace = rpc_sysfs_xprt_switch_namespace,
445447
};
446448

447449
static struct kobj_type rpc_sysfs_xprt_type = {
448450
.release = rpc_sysfs_xprt_release,
449-
.default_attrs = rpc_sysfs_xprt_attrs,
451+
.default_groups = rpc_sysfs_xprt_groups,
450452
.sysfs_ops = &kobj_sysfs_ops,
451453
.namespace = rpc_sysfs_xprt_namespace,
452454
};

0 commit comments

Comments
 (0)