diff options
| author | Mike Christie <mchristi@redhat.com> | 2016-08-18 12:38:43 -0400 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@gmail.com> | 2016-08-24 17:49:16 -0400 |
| commit | 267fb90b8344eeb6f835734e356b422f78617088 (patch) | |
| tree | a808678b203e4fcbba4de10828b48a557344fd11 /drivers/block | |
| parent | 005a07bf0a92e7f0e73fc9a6c9acc992c5dbd00c (diff) | |
rbd: add 'cluster_fsid' sysfs rbd device attribute
Export the cluster fsid, so tools like udev and multipath-tools can use
it for part of the uuid.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'drivers/block')
| -rw-r--r-- | drivers/block/rbd.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 69d76c3afcdd..c95104a80065 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -4612,6 +4612,14 @@ static ssize_t rbd_client_id_show(struct device *dev, | |||
| 4612 | ceph_client_gid(rbd_dev->rbd_client->client)); | 4612 | ceph_client_gid(rbd_dev->rbd_client->client)); |
| 4613 | } | 4613 | } |
| 4614 | 4614 | ||
| 4615 | static ssize_t rbd_cluster_fsid_show(struct device *dev, | ||
| 4616 | struct device_attribute *attr, char *buf) | ||
| 4617 | { | ||
| 4618 | struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); | ||
| 4619 | |||
| 4620 | return sprintf(buf, "%pU\n", &rbd_dev->rbd_client->client->fsid); | ||
| 4621 | } | ||
| 4622 | |||
| 4615 | static ssize_t rbd_pool_show(struct device *dev, | 4623 | static ssize_t rbd_pool_show(struct device *dev, |
| 4616 | struct device_attribute *attr, char *buf) | 4624 | struct device_attribute *attr, char *buf) |
| 4617 | { | 4625 | { |
| @@ -4715,6 +4723,7 @@ static DEVICE_ATTR(major, S_IRUGO, rbd_major_show, NULL); | |||
| 4715 | static DEVICE_ATTR(minor, S_IRUGO, rbd_minor_show, NULL); | 4723 | static DEVICE_ATTR(minor, S_IRUGO, rbd_minor_show, NULL); |
| 4716 | static DEVICE_ATTR(client_addr, S_IRUGO, rbd_client_addr_show, NULL); | 4724 | static DEVICE_ATTR(client_addr, S_IRUGO, rbd_client_addr_show, NULL); |
| 4717 | static DEVICE_ATTR(client_id, S_IRUGO, rbd_client_id_show, NULL); | 4725 | static DEVICE_ATTR(client_id, S_IRUGO, rbd_client_id_show, NULL); |
| 4726 | static DEVICE_ATTR(cluster_fsid, S_IRUGO, rbd_cluster_fsid_show, NULL); | ||
| 4718 | static DEVICE_ATTR(pool, S_IRUGO, rbd_pool_show, NULL); | 4727 | static DEVICE_ATTR(pool, S_IRUGO, rbd_pool_show, NULL); |
| 4719 | static DEVICE_ATTR(pool_id, S_IRUGO, rbd_pool_id_show, NULL); | 4728 | static DEVICE_ATTR(pool_id, S_IRUGO, rbd_pool_id_show, NULL); |
| 4720 | static DEVICE_ATTR(name, S_IRUGO, rbd_name_show, NULL); | 4729 | static DEVICE_ATTR(name, S_IRUGO, rbd_name_show, NULL); |
| @@ -4730,6 +4739,7 @@ static struct attribute *rbd_attrs[] = { | |||
| 4730 | &dev_attr_minor.attr, | 4739 | &dev_attr_minor.attr, |
| 4731 | &dev_attr_client_addr.attr, | 4740 | &dev_attr_client_addr.attr, |
| 4732 | &dev_attr_client_id.attr, | 4741 | &dev_attr_client_id.attr, |
| 4742 | &dev_attr_cluster_fsid.attr, | ||
| 4733 | &dev_attr_pool.attr, | 4743 | &dev_attr_pool.attr, |
| 4734 | &dev_attr_pool_id.attr, | 4744 | &dev_attr_pool_id.attr, |
| 4735 | &dev_attr_name.attr, | 4745 | &dev_attr_name.attr, |
