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_device for which to return the name. The value must be of type struct 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_device back to the struct block_device.

Parameters:

dev – A struct device'' contained within a ``struct block_device. The vlaue must be of type struct device.

Returns:

The converted block device. The value is of type struct block_device.

Return type:

gdb.Value

crash.subsystem.storage.dev_to_gendisk(dev: Value) Value[source]

Converts a struct device that is embedded in a struct gendisk back to the struct gendisk.

Parameters:

dev – A struct device contained within a struct gendisk. The value must be of type struct device.

Returns:

The converted gendisk. The value is of type struct gendisk.

Return type:

gdb.Value

crash.subsystem.storage.dev_to_part(dev: Value) Value[source]

Converts a struct device that is embedded in a struct hd_struct back to the struct hd_struct.

Parameters:

dev – A struct device embedded within a struct hd_struct. The value must be of type struct device.

Returns:

The converted struct hd_struct. The value is of type struct hd_struct.

Return type:

gdb.Value

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_type that will be used to match and filter. Typically the values associated with the disk_type or part_type gdb.Symbol.

Yields:

gdb.Value – The next block device that matches the subtype. The value is of type struct gendisk or struct hd_struct.

Raises:
  • RuntimeError – An unknown device type was encountered during iteration.

  • TypeError – The provided subtype was not of struct device_type or struct 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 gendisk or struct hd_struct for which to return the name. The value must be of type struct gendisk or struct hd_struct.

Returns:

The name of the block device

Return type:

str

Raises:

.InvalidArgumentError – gendisk does not describe a struct gendisk or struct hd_struct

crash.subsystem.storage.gendisk_to_dev(gendisk: Value) Value[source]

Converts a struct gendisk that embeds a struct device to the struct device.

Parameters:

dev – A struct gendisk that embeds a struct device. The value must be of type struct device.

Returns:

The converted struct device. The value is of type struct device.

Return type:

gdb.Value

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 inode for which to return the associated block device. The value must be of type struct inode.

Returns:

The struct block_device associated with the provided struct inode. The value is of type struct inode.

Return type:

gdb.Value

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 inode for which to return the associated block device. The value must be of type struct inode.

Returns:

The struct block_device associated with the provided struct inode. The value is of type struct block_device.

Return type:

gdb.Value

Raises:

.InvalidArgumentError – inode does not describe a block device

crash.subsystem.storage.is_bdev_inode(inode: Value) bool[source]

Tests whether the provided struct inode describes a block device

This method evaluates the inode and returns True or False, depending on whether the inode describes a block device.

Parameters:

bdev – The struct inode to test whether it describes a block device. The value must be of type struct inode.

Returns:

True if the inode describes a block device, False otherwise.

Return type:

bool

crash.subsystem.storage.part_to_dev(part: Value) Value[source]

Converts a struct hd_struct that embeds a struct device to the struct device.

Parameters:

dev – A struct hd_struct that embeds a struct device. The value must be of type struct device.

Returns:

The converted struct device. The value is of type struct device.

Return type:

gdb.Value

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_queue is 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’s start_time, in milliseconds.

Parameters:

request – The struct request used to determine age. The value is of type struct request.

Returns:

Difference between the request’s start_time and

current jiffies in milliseconds.

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 request to 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 request to 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 request to query.

Returns:

True for synchronous requests, False otherwise.

Return type:

bool

Submodules