aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2013-12-13 08:28:57 -0500
committerIlya Dryomov <ilya.dryomov@inktank.com>2013-12-31 13:31:58 -0500
commit92c76dc036e2139226e90851864d3e01e1db5dd8 (patch)
tree42144ae75306581bb4c748c43cd09388c57c1b60 /drivers/block
parentdd82fff1e8e7b486887dd88981776bb44e370848 (diff)
rbd: wire up is_visible() sysfs callback for rbd bus
In preparation for single-major device number allocation scheme, wire up attribute_group::is_visible() callback for rbd bus. This allows us to make the new single-major attributes conditional. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 01ed7672a076..3fa18b0c5e4d 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -408,7 +408,18 @@ static struct attribute *rbd_bus_attrs[] = {
408 &bus_attr_remove.attr, 408 &bus_attr_remove.attr,
409 NULL, 409 NULL,
410}; 410};
411ATTRIBUTE_GROUPS(rbd_bus); 411
412static umode_t rbd_bus_is_visible(struct kobject *kobj,
413 struct attribute *attr, int index)
414{
415 return attr->mode;
416}
417
418static const struct attribute_group rbd_bus_group = {
419 .attrs = rbd_bus_attrs,
420 .is_visible = rbd_bus_is_visible,
421};
422__ATTRIBUTE_GROUPS(rbd_bus);
412 423
413static struct bus_type rbd_bus_type = { 424static struct bus_type rbd_bus_type = {
414 .name = "rbd", 425 .name = "rbd",