bd_link_disk_holder9
Create symlinks between holding disk and slave bdev
Usage
int bd_link_disk_holder(struct block_device * bdev, struct gendisk * disk);
Arguments
bdev
the claimed slave bdev
disk
the holding disk
Overview
DON'T USE THIS UNLESS YOU'RE ALREADY USING IT.
This functions creates the following sysfs symlinks.
- from “slaves” directory of the holder disk to the claimed bdev - from “holders” directory of the bdev to the holder disk
For example, if /dev/dm-0 maps to /dev/sda and disk for dm-0 is passed to bd_link_disk_holder, then:
/sys/block/dm-0/slaves/sda --> /sys/block/sda /sys/block/sda/holders/dm-0 --> /sys/block/dm-0
The caller must have claimed bdev before calling this function and ensure that both bdev and disk are valid during the creation and lifetime of these symlinks.
Context
Might sleep.
Return
0 on success, -errno on failure.
Releases
3 releases since Debian 7 (Wheezy); the text changed 2 times.