crash.subsystem.storage package¶
- crash.subsystem.storage.REQ_FUA: int¶
- crash.subsystem.storage.REQ_PREFLUSH: int¶
- crash.subsystem.storage.REQ_STARTED: int¶
- crash.subsystem.storage.REQ_SYNC: int¶
- crash.subsystem.storage.block_device_name(bdev: Value) str[source]¶
Returns the name of the provided block device.
This method evaluates the block device and returns the name, including partition number, if applicable.
- Parameters:
bdev – A
struct block_devicefor which to return the name. The value must be of typestruct block_device.- Returns:
The name of the block device
- Return type:
str
- crash.subsystem.storage.dev_to_bdev(dev: Value) Value[source]¶
Converts a
struct device'' that is embedded in a ``struct block_deviceback to thestruct block_device.- Parameters:
dev – A
struct device'' contained within a ``struct block_device. The vlaue must be of typestruct device.- Returns:
The converted block device. The value is of type
struct block_device.- Return type:
- crash.subsystem.storage.dev_to_gendisk(dev: Value) Value[source]¶
Converts a
struct devicethat is embedded in astruct gendiskback to thestruct gendisk.- Parameters:
dev – A
struct devicecontained within astruct gendisk. The value must be of typestruct device.- Returns:
The converted gendisk. The value is of type
struct gendisk.- Return type:
- crash.subsystem.storage.dev_to_part(dev: Value) Value[source]¶
Converts a
struct devicethat is embedded in astruct hd_structback to thestruct hd_struct.- Parameters:
dev – A
struct deviceembedded within astruct hd_struct. The value must be of typestruct device.- Returns:
The converted
struct hd_struct. The value is of typestruct hd_struct.- Return type:
- crash.subsystem.storage.for_each_block_device(subtype: Value = None) Iterable[Value][source]¶
Iterates over each block device registered with the block class.
This method iterates over the block_class klist and yields every member found. The members are either struct gendisk or struct hd_struct, depending on whether it describes an entire disk or a partition, respectively.
The members can be filtered by providing a subtype, which corresponds to a the the type field of the struct device.
- Parameters:
subtype (optional) – The
struct device_typethat will be used to match and filter. Typically the values associated with thedisk_typeorpart_typegdb.Symbol.- Yields:
gdb.Value– The next block device that matches the subtype. The value is of typestruct gendiskorstruct hd_struct.- Raises:
RuntimeError – An unknown device type was encountered during iteration.
TypeError – The provided subtype was not of
struct device_typeorstruct device type *
- crash.subsystem.storage.for_each_disk() Iterable[Value][source]¶
Iterates over each block device registered with the block class that corresponds to an entire disk.
This is an alias for for_each_block_device(
disk_type)
- crash.subsystem.storage.gendisk_name(gendisk: Value) str[source]¶
Returns the name of the provided block device.
This method evaluates the block device and returns the name, including partition number, if applicable.
- Parameters:
gendisk – A
struct gendiskorstruct hd_structfor which to return the name. The value must be of typestruct gendiskorstruct hd_struct.- Returns:
The name of the block device
- Return type:
str- Raises:
.InvalidArgumentError – gendisk does not describe a
struct gendiskorstruct hd_struct
- crash.subsystem.storage.gendisk_to_dev(gendisk: Value) Value[source]¶
Converts a
struct gendiskthat embeds astruct deviceto thestruct device.- Parameters:
dev – A
struct gendiskthat embeds astruct device. The value must be of typestruct device.- Returns:
The converted
struct device. The value is of typestruct device.- Return type:
- crash.subsystem.storage.inode_on_bdev(inode: Value) Value[source]¶
Returns the block device associated with this inode.
If the inode describes a block device, return that block device. Otherwise, return the block device, if any, associated with the inode’s super block.
- Parameters:
inode – The
struct inodefor which to return the associated block device. The value must be of typestruct inode.- Returns:
The
struct block_deviceassociated with the providedstruct inode. The value is of typestruct inode.- Return type:
- crash.subsystem.storage.inode_to_block_device(inode: Value) Value[source]¶
Returns the block device associated with this inode.
If the inode describes a block device, return that block device. Otherwise, raise InvalidArgumentError.
- Parameters:
inode – The
struct inodefor which to return the associated block device. The value must be of typestruct inode.- Returns:
The
struct block_deviceassociated with the providedstruct inode. The value is of typestruct block_device.- Return type:
- Raises:
.InvalidArgumentError – inode does not describe a block device
- crash.subsystem.storage.is_bdev_inode(inode: Value) bool[source]¶
Tests whether the provided
struct inodedescribes a block deviceThis method evaluates the inode and returns
TrueorFalse, depending on whether the inode describes a block device.- Parameters:
bdev – The
struct inodeto test whether it describes a block device. The value must be of typestruct inode.- Returns:
Trueif the inode describes a block device,Falseotherwise.- Return type:
bool
- crash.subsystem.storage.part_to_dev(part: Value) Value[source]¶
Converts a
struct hd_structthat embeds astruct deviceto thestruct device.- Parameters:
dev – A
struct hd_structthat embeds astruct device. The value must be of typestruct device.- Returns:
The converted
struct device. The value is of typestruct device.- Return type:
- crash.subsystem.storage.queue_is_mq(queue: Value) bool[source]¶
Tests whether the queue is blk-mq queue.
- Parameters:
queue – The request queue to test. The value must be of type
struct request_queue.- Returns:
whether the
struct request_queueis a multiqueue queue- Return type:
bool
- crash.subsystem.storage.request_age_ms(request: Value) int[source]¶
Returns the age of the request in milliseconds
This method returns the difference between the current time (
jiffies) and the request’sstart_time, in milliseconds.- Parameters:
request – The
struct requestused to determine age. The value is of typestruct request.- Returns:
- Difference between the request’s
start_timeand current
jiffiesin milliseconds.
- Difference between the request’s
- Return type:
int
- crash.subsystem.storage.rq_data_dir(request: Value) int[source]¶
Returns direction of the request
This method returns 0 if the request is read and 1 if the request is write.
- Parameters:
request – The
struct requestto query data direction in.- Returns:
0 for reads, 1 for writes.
- Return type:
int
- crash.subsystem.storage.rq_in_flight(request: Value) bool[source]¶
Returns whether request is currently processed by the device
This method returns True if the request is being processed by the device
- Parameters:
request – The
struct requestto query.- Returns:
True for requests in flight, False otherwise.
- Return type:
bool
- crash.subsystem.storage.rq_is_sync(request: Value) bool[source]¶
Returns whether request is synchronous
This method returns True if the request is synchronous and False otherwise.
- Parameters:
request – The
struct requestto query.- Returns:
True for synchronous requests, False otherwise.
- Return type:
bool
Submodules¶
- crash.subsystem.storage.block module
- crash.subsystem.storage.blockmq module
- crash.subsystem.storage.blocksq module
- crash.subsystem.storage.decoders module
- crash.subsystem.storage.device_mapper module