• Coly Li's avatar
    bcache: export backing_dev_uuid via sysfs · d4610456
    Coly Li authored
    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: default avatarColy Li <colyli@suse.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    d4610456
sysfs.c 26.4 KB