crash.subsystem.storage package¶
-
crash.subsystem.storage.
block_device_name
(bdev: gdb.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 typestruct block_device
.Returns: The name of the block device Return type: str
-
crash.subsystem.storage.
dev_to_gendisk
(dev: gdb.Value) → gdb.Value[source]¶ Converts a
struct device
that is embedded in astruct gendisk
back to thestruct gendisk
.Parameters: dev – A struct device
contained within astruct gendisk
. The value must be of typestruct device
.Returns: The converted gendisk. The value is of type struct gendisk
.Return type: gdb.Value
-
crash.subsystem.storage.
dev_to_part
(dev: gdb.Value) → gdb.Value[source]¶ Converts a
struct device
that is embedded in astruct hd_struct
back to thestruct hd_struct
.Parameters: dev – A struct device
embedded 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: gdb.Value
-
crash.subsystem.storage.
for_each_block_device
(subtype: gdb.Value = None) → Iterable[gdb.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 thedisk_type
orpart_type
gdb.Symbol
.Yields: gdb.Value
– The next block device that matches the subtype. The value is of typestruct gendisk
orstruct hd_struct
.Raises: RuntimeError
– An unknown device type was encountered during iteration.TypeError
– The provided subtype was not ofstruct device_type
orstruct device type *
-
crash.subsystem.storage.
for_each_disk
() → Iterable[gdb.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: gdb.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
orstruct hd_struct
for which to return the name. The value must be of typestruct gendisk
orstruct hd_struct
.Returns: The name of the block device Return type: str
Raises: InvalidArgumentError
– gendisk does not describe astruct gendisk
orstruct hd_struct
-
crash.subsystem.storage.
gendisk_to_dev
(gendisk: gdb.Value) → gdb.Value[source]¶ Converts a
struct gendisk
that embeds astruct device
to thestruct device
.Parameters: dev – A struct gendisk
that embeds astruct device
. The value must be of typestruct device
.Returns: The converted struct device
. The value is of typestruct device
.Return type: gdb.Value
-
crash.subsystem.storage.
inode_on_bdev
(inode: gdb.Value) → gdb.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 typestruct inode
.Returns: The struct block_device
associated with the providedstruct inode
. The value is of typestruct inode
.Return type: gdb.Value
-
crash.subsystem.storage.
inode_to_block_device
(inode: gdb.Value) → gdb.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 typestruct inode
.Returns: The struct block_device
associated with the providedstruct inode
. The value is of typestruct block_device
.Return type: gdb.Value
Raises: InvalidArgumentError
– inode does not describe a block device
-
crash.subsystem.storage.
is_bdev_inode
(inode: gdb.Value) → bool[source]¶ Tests whether the provided
struct inode
describes a block deviceThis method evaluates the inode and returns
True
orFalse
, 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 typestruct inode
.Returns: True
if the inode describes a block device,False
otherwise.Return type: bool
-
crash.subsystem.storage.
part_to_dev
(part: gdb.Value) → gdb.Value[source]¶ Converts a
struct hd_struct
that embeds astruct device
to thestruct device
.Parameters: dev – A struct hd_struct
that embeds astruct device
. The value must be of typestruct device
.Returns: The converted struct device
. The value is of typestruct device
.Return type: gdb.Value