Commit d9e1241e469bbd4b483e0996e404fdce46735b48

Authored by Greg Kroah-Hartman
1 parent bd0eae4e1c

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>

Showing 1 changed file with 11 additions and 8 deletions Side-by-side Diff

... ... @@ -180,7 +180,8 @@
180 180 struct backing_dev_info *bdi = dev_get_drvdata(dev); \
181 181 \
182 182 return snprintf(page, PAGE_SIZE-1, "%lld\n", (long long)expr); \
183   -}
  183 +} \
  184 +static DEVICE_ATTR_RW(name);
184 185  
185 186 BDI_SHOW(read_ahead_kb, K(bdi->ra_pages))
186 187  
187 188  
188 189  
... ... @@ -231,14 +232,16 @@
231 232 return snprintf(page, PAGE_SIZE-1, "%d\n",
232 233 bdi_cap_stable_pages_required(bdi) ? 1 : 0);
233 234 }
  235 +static DEVICE_ATTR_RO(stable_pages_required);
234 236  
235   -static struct device_attribute bdi_dev_attrs[] = {
236   - __ATTR_RW(read_ahead_kb),
237   - __ATTR_RW(min_ratio),
238   - __ATTR_RW(max_ratio),
239   - __ATTR_RO(stable_pages_required),
240   - __ATTR_NULL,
  237 +static struct attribute *bdi_dev_attrs[] = {
  238 + &dev_attr_read_ahead_kb.attr,
  239 + &dev_attr_min_ratio.attr,
  240 + &dev_attr_max_ratio.attr,
  241 + &dev_attr_stable_pages_required.attr,
  242 + NULL,
241 243 };
  244 +ATTRIBUTE_GROUPS(bdi_dev);
242 245  
243 246 static __init int bdi_class_init(void)
244 247 {
... ... @@ -246,7 +249,7 @@
246 249 if (IS_ERR(bdi_class))
247 250 return PTR_ERR(bdi_class);
248 251  
249   - bdi_class->dev_attrs = bdi_dev_attrs;
  252 + bdi_class->dev_groups = bdi_dev_groups;
250 253 bdi_debug_init();
251 254 return 0;
252 255 }