]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: export backing_dev_uuid via sysfs
authorColy Li <colyli@suse.de>
Sat, 9 Feb 2019 04:52:56 +0000 (12:52 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 Feb 2019 14:18:31 +0000 (07:18 -0700)
commit81bdc461bd0e11b511c083431175633b398c3848
treeaed9005a0d5c2bfb10c9c4d19814e1cad54cb76d
parentdafc355e586f81715fe8187414b65ce7a07addc7
bcache: export backing_dev_uuid via sysfs

When there are multiple bcache devices, after a reboot the name of
bcache devices may change (e.g. current /dev/bcache1 was /dev/bcache0
before reboot). Therefore we need the backing device UUID (sb.uuid) to
identify each bcache device.

Backing device uuid can be found by program bcache-super-show, but
directly exporting backing_dev_uuid by sysfs file
/sys/block/bcache<?>/bcache/backing_dev_uuid is a much simpler method.

With backing_dev_uuid, and partition uuids from /dev/disk/by-partuuid/,
now we can identify each bcache device and its partitions conveniently.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/sysfs.c