提交 86439fa2 编写于 作者: G Greg Kroah-Hartman 提交者: Anna Schumaker

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 aa30f47c ("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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
上级 01f34245
...@@ -422,6 +422,7 @@ static struct attribute *rpc_sysfs_xprt_attrs[] = { ...@@ -422,6 +422,7 @@ static struct attribute *rpc_sysfs_xprt_attrs[] = {
&rpc_sysfs_xprt_change_state.attr, &rpc_sysfs_xprt_change_state.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(rpc_sysfs_xprt);
static struct kobj_attribute rpc_sysfs_xprt_switch_info = static struct kobj_attribute rpc_sysfs_xprt_switch_info =
__ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL); __ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL);
...@@ -430,6 +431,7 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = { ...@@ -430,6 +431,7 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
&rpc_sysfs_xprt_switch_info.attr, &rpc_sysfs_xprt_switch_info.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
static struct kobj_type rpc_sysfs_client_type = { static struct kobj_type rpc_sysfs_client_type = {
.release = rpc_sysfs_client_release, .release = rpc_sysfs_client_release,
...@@ -439,14 +441,14 @@ static struct kobj_type rpc_sysfs_client_type = { ...@@ -439,14 +441,14 @@ static struct kobj_type rpc_sysfs_client_type = {
static struct kobj_type rpc_sysfs_xprt_switch_type = { static struct kobj_type rpc_sysfs_xprt_switch_type = {
.release = rpc_sysfs_xprt_switch_release, .release = rpc_sysfs_xprt_switch_release,
.default_attrs = rpc_sysfs_xprt_switch_attrs, .default_groups = rpc_sysfs_xprt_switch_groups,
.sysfs_ops = &kobj_sysfs_ops, .sysfs_ops = &kobj_sysfs_ops,
.namespace = rpc_sysfs_xprt_switch_namespace, .namespace = rpc_sysfs_xprt_switch_namespace,
}; };
static struct kobj_type rpc_sysfs_xprt_type = { static struct kobj_type rpc_sysfs_xprt_type = {
.release = rpc_sysfs_xprt_release, .release = rpc_sysfs_xprt_release,
.default_attrs = rpc_sysfs_xprt_attrs, .default_groups = rpc_sysfs_xprt_groups,
.sysfs_ops = &kobj_sysfs_ops, .sysfs_ops = &kobj_sysfs_ops,
.namespace = rpc_sysfs_xprt_namespace, .namespace = rpc_sysfs_xprt_namespace,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册