Skip to content

Commit

Permalink
rbd: wire up is_visible() sysfs callback for rbd bus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilya Dryomov committed Dec 31, 2013
1 parent dd82fff commit 92c76dc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,18 @@ static struct attribute *rbd_bus_attrs[] = {
&bus_attr_remove.attr,
NULL,
};
ATTRIBUTE_GROUPS(rbd_bus);

static umode_t rbd_bus_is_visible(struct kobject *kobj,
struct attribute *attr, int index)
{
return attr->mode;
}

static const struct attribute_group rbd_bus_group = {
.attrs = rbd_bus_attrs,
.is_visible = rbd_bus_is_visible,
};
__ATTRIBUTE_GROUPS(rbd_bus);

static struct bus_type rbd_bus_type = {
.name = "rbd",
Expand Down

0 comments on commit 92c76dc

Please sign in to comment.