1BD_LINK_DISK_HOLDER(9) The Linux VFS BD_LINK_DISK_HOLDER(9)
2
3
4
6 bd_link_disk_holder - create symlinks between holding disk and slave
7 bdev
8
10 int bd_link_disk_holder(struct block_device * bdev,
11 struct gendisk * disk);
12
14 bdev
15 the claimed slave bdev
16
17 disk
18 the holding disk
19
21 DON'T USE THIS UNLESS YOU'RE ALREADY USING IT.
22
23 This functions creates the following sysfs symlinks.
24
25 - from “slaves” directory of the holder disk to the claimed bdev - from
26 “holders” directory of the bdev to the holder disk
27
28 For example, if /dev/dm-0 maps to /dev/sda and disk for dm-0 is passed
29 to bd_link_disk_holder, then:
30
31 /sys/block/dm-0/slaves/sda --> /sys/block/sda
32 /sys/block/sda/holders/dm-0 --> /sys/block/dm-0
33
34 The caller must have claimed bdev before calling this function and
35 ensure that both bdev and disk are valid during the creation and
36 lifetime of these symlinks.
37
39 Might sleep.
40
42 0 on success, -errno on failure.
43
45Kernel Hackers Manual 3.10 June 2019 BD_LINK_DISK_HOLDER(9)