Generic Block Device Capability¶
This file documents the sysfs file block/<disk>/capability
.
capability
is a bitfield, printed in hexadecimal, indicating which
capabilities a specific block device supports:
genhd capability flags
GENHD_FL_REMOVABLE
(0x0001): indicates that the block device
gives access to removable media.
When set, the device remains present even when media is not
inserted.
Must not be set for devices which are removed entirely when the
media is removed.
GENHD_FL_CD
(0x0008): the block device is a CD-ROM-style
device.
Affects responses to the CDROM_GET_CAPABILITY
ioctl.
GENHD_FL_SUPPRESS_PARTITION_INFO
(0x0020): don’t include
partition information in /proc/partitions
or in the output of
printk_all_partitions().
Used for the null block device and some MMC devices.
GENHD_FL_EXT_DEVT
(0x0040): the driver supports extended
dynamic dev_t
, i.e. it wants extended device numbers
(BLOCK_EXT_MAJOR
).
This affects the maximum number of partitions.
GENHD_FL_NO_PART
(0x0200): partition support is disabled.
The kernel will not scan for partitions from add_disk, and users
can’t add partitions manually.
GENHD_FL_HIDDEN
(0x0400): the block device is hidden; it
doesn’t produce events, doesn’t appear in sysfs, and doesn’t have
an associated bdev
.
Implies GENHD_FL_SUPPRESS_PARTITION_INFO
and
GENHD_FL_NO_PART
.
Used for multipath devices.
-
blk_alloc_disk
(node_id)¶ allocate a gendisk structure
Parameters
node_id
- numa node to allocate on
Description
Allocate and pre-initialize a gendisk structure for use with BIO based drivers.
Context
can sleep