1BLKDEV_GET_BY_DEV(9) The Linux VFS BLKDEV_GET_BY_DEV(9)
2
3
4
6 blkdev_get_by_dev - open a block device by device number
7
9 struct block_device * blkdev_get_by_dev(dev_t dev, fmode_t mode,
10 void * holder);
11
13 dev
14 device number of block device to open
15
16 mode
17 FMODE_* mask
18
19 holder
20 exclusive holder identifier
21
23 Open the blockdevice described by device number dev. mode and holder
24 are identical to blkdev_get.
25
26 Use it ONLY if you really do not have anything better - i.e. when you
27 are behind a truly sucky interface and all you are given is a device
28 number. _Never_ to be used for internal purposes. If you ever need it -
29 reconsider your API.
30
31 On success, the returned block_device has reference count of one.
32
34 Might sleep.
35
37 Pointer to block_device on success, ERR_PTR(-errno) on failure.
38
40Kernel Hackers Manual 3.10 June 2019 BLKDEV_GET_BY_DEV(9)