backing-dev: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the backing device class code to use the correct field. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jan Kara <jack@suse.cz> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bd0eae4e1c
commit
d9e1241e46
1 changed files with 11 additions and 8 deletions
|
@ -180,7 +180,8 @@ static ssize_t name##_show(struct device *dev, \
|
||||||
struct backing_dev_info *bdi = dev_get_drvdata(dev); \
|
struct backing_dev_info *bdi = dev_get_drvdata(dev); \
|
||||||
\
|
\
|
||||||
return snprintf(page, PAGE_SIZE-1, "%lld\n", (long long)expr); \
|
return snprintf(page, PAGE_SIZE-1, "%lld\n", (long long)expr); \
|
||||||
}
|
} \
|
||||||
|
static DEVICE_ATTR_RW(name);
|
||||||
|
|
||||||
BDI_SHOW(read_ahead_kb, K(bdi->ra_pages))
|
BDI_SHOW(read_ahead_kb, K(bdi->ra_pages))
|
||||||
|
|
||||||
|
@ -231,14 +232,16 @@ static ssize_t stable_pages_required_show(struct device *dev,
|
||||||
return snprintf(page, PAGE_SIZE-1, "%d\n",
|
return snprintf(page, PAGE_SIZE-1, "%d\n",
|
||||||
bdi_cap_stable_pages_required(bdi) ? 1 : 0);
|
bdi_cap_stable_pages_required(bdi) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RO(stable_pages_required);
|
||||||
|
|
||||||
static struct device_attribute bdi_dev_attrs[] = {
|
static struct attribute *bdi_dev_attrs[] = {
|
||||||
__ATTR_RW(read_ahead_kb),
|
&dev_attr_read_ahead_kb.attr,
|
||||||
__ATTR_RW(min_ratio),
|
&dev_attr_min_ratio.attr,
|
||||||
__ATTR_RW(max_ratio),
|
&dev_attr_max_ratio.attr,
|
||||||
__ATTR_RO(stable_pages_required),
|
&dev_attr_stable_pages_required.attr,
|
||||||
__ATTR_NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(bdi_dev);
|
||||||
|
|
||||||
static __init int bdi_class_init(void)
|
static __init int bdi_class_init(void)
|
||||||
{
|
{
|
||||||
|
@ -246,7 +249,7 @@ static __init int bdi_class_init(void)
|
||||||
if (IS_ERR(bdi_class))
|
if (IS_ERR(bdi_class))
|
||||||
return PTR_ERR(bdi_class);
|
return PTR_ERR(bdi_class);
|
||||||
|
|
||||||
bdi_class->dev_attrs = bdi_dev_attrs;
|
bdi_class->dev_groups = bdi_dev_groups;
|
||||||
bdi_debug_init();
|
bdi_debug_init();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue