]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd: match against whole disks on unmap
authorIlya Dryomov <ilya.dryomov@inktank.com>
Fri, 13 Dec 2013 15:40:52 +0000 (17:40 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Fri, 13 Dec 2013 15:40:52 +0000 (17:40 +0200)
commit462b3898e5016ce49c5c1c4828f68d5011b9e7ce
treebd14bf4927f4214621da189827fd7e1afadaaddf
parenta42130592d4f3aebc6b1080a12c942b650fc5349
rbd: match against whole disks on unmap

Currently the way 'rbd unmap' translates a user-provided block device
into an rbd id is it matches the major number of the specified device
against /sys/bus/rbd/devices/<id>/major for each rbd mapping and
declares success on the first match.  This works for both entire disks
and partitions, because under the current device number allocation
scheme, each mapping means a new major number.

In preparation for support for single-major device number allocation
scheme, which would require matching both major and minor numbers, make
sure to always match against entire disk device numbers, by converting
the specified device major:minor pair into wholdedisk major:minor pair.
To achive that, use the libblkid library, which accomplishes this goal
by walking stable sysfs structures.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
README
ceph.spec.in
configure.ac
debian/control
src/Makefile.am
src/rbd.cc