]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: define rbd_dev_image_id()
authorAlex Elder <elder@inktank.com>
Wed, 11 Jul 2012 01:30:11 +0000 (20:30 -0500)
committerAlex Elder <elder@inktank.com>
Mon, 1 Oct 2012 19:30:53 +0000 (14:30 -0500)
commit8eeab9098f0062dc5cda2ae4e61c936913e3c396
tree7430a5eea84dc3378ba69a5cd563577afb98b228
parent8ac579dca02591beeb0601cf606d19a3798f9dd1
rbd: define rbd_dev_image_id()

New format 2 rbd images are permanently identified by a unique image
id.  Each rbd image also has a name, but the name can be changed.
A format 2 rbd image will have an object--whose name is based on the
image name--which maps an image's name to its image id.

Create a new function rbd_dev_image_id() that checks for the
existence of the image id object, and if it's found, records the
image id in the rbd_device structure.

Create a new rbd device attribute (/sys/bus/rbd/<num>/image_id) that
makes this information available.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Documentation/ABI/testing/sysfs-bus-rbd
drivers/block/rbd.c