crash.subsystem.filesystem.xfs module¶
The crash.subsystem.filesystem.xfs module offers helpers to work with XFS file systems.
- class crash.subsystem.filesystem.xfs.XFS[source]¶
Bases:
objectXFS File system state class. Not meant to be instantiated directly.
- classmethod detect_ail_version(gdbtype: Type) None[source]¶
Detect what version of the ail structure is in use
Linux v4.17 renamed the xfs_ail members to use ail_* instead of xa_* except for xa_ail which was renamed to ail_head.
Meant to be used as a TypeCallback.
- Parameters:
gdbtype – The
struct xfs_ailtype.
- class crash.subsystem.filesystem.xfs.XFSBufBioDecoder(bio: Value)[source]¶
Bases:
DecoderDecodes a bio with an xfsbuf ->bi_end_io
- Parameters:
bio – The struct bio to decode. The value must be of type
struct bio.
- devname¶
The string representation of the device name
- Type:
str
- class crash.subsystem.filesystem.xfs.XFSBufDecoder(xfsbuf: Value)[source]¶
Bases:
DecoderDecodes a struct xfs_buf into human-readable form
- crash.subsystem.filesystem.xfs.is_xfs_inode(vfs_inode: Value) bool[source]¶
Tests whether a generic
struct inodebelongs to XFS- Parameters:
vfs_inode – The struct inode to test whether it belongs to XFS. The value must be of type
struct inode.- Returns:
Whether the inode belongs to XFS
- Return type:
bool- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.is_xfs_super(super_block: Value) bool[source]¶
Tests whether a
struct super_blockbelongs to XFS.- Parameters:
super_block – The struct super_block to test. The value must be of type
struct super_block.- Returns:
Whether the super_block belongs to XFS
- Return type:
bool- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.item_to_buf_log_item(item: Value) Value[source]¶
Converts an xfs_log_item to an xfs_buf_log_item
- Parameters:
item – The log item to convert. The value must be of type
struct xfs_log_item.- Returns:
The converted log item. The value will be of type
struct xfs_buf_log_item.- Return type:
- Raises:
InvalidArgumentError – The type of log item is not
XFS_LI_BUFgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.item_to_dquot_log_item(item: Value) Value[source]¶
Converts an xfs_log_item to an xfs_dquot_log_item
- Parameters:
item – The log item to convert. The value must of of type
struct xfs_log_item.- Returns:
The converted log item. The value will be of type
struct xfs_dquot_log_item.- Return type:
- Raises:
InvalidArgumentError – The type of log item is not
XFS_LI_DQUOTgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.item_to_efd_log_item(item: Value) Value[source]¶
Converts an xfs_log_item to an xfs_efd_log_item
- Parameters:
item – The log item to convert. The value must of of type
xfs_log_item. (struct)
- Returns:
The converted log item. The value will be of type
struct xfs_efd_log_item.- Return type:
- Raises:
InvalidArgumentError – The type of log item is not
XFS_LI_EFDgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.item_to_efi_log_item(item: Value) Value[source]¶
Converts an xfs_log_item to an xfs_efi_log_item
- Parameters:
item – The log item to convert. The value must of of type
struct xfs_log_item.- Returns:
The converted log item. The value will be of type
struct xfs_efi_log_item.- Return type:
- Raises:
InvalidArgumentError – The type of log item is not
XFS_LI_EFIgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.item_to_inode_log_item(item: Value) Value[source]¶
Converts an xfs_log_item to an xfs_inode_log_item
- Parameters:
item – The log item to convert. The value must of of type
struct xfs_log_item.- Returns:
The converted log item. The value will be of type
struct xfs_inode_log_item.- Return type:
- Raises:
InvalidArgumentError – The type of log item is not
XFS_LI_INODEgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.item_to_quotaoff_log_item(item: Value) Value[source]¶
Converts an xfs_log_item to an xfs_quotaoff_log_item
- Parameters:
item – The log item to convert. The value must be of type
struct xfs_log_item.- Returns:
The converted log item. The value will be of type
struct xfs_quotaoff_log_item- Return type:
- Raises:
InvalidArgumentError – The type of log item is not
XFS_LI_QUOTAOFFgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_for_each_ail_entry(ail: Value) Iterable[Value][source]¶
Iterates over the XFS Active Item Log and returns each item
- Parameters:
ail – The XFS AIL to iterate. The value must be of type
struct xfs_ail.- Yields:
gdb.Value– A log item from the AIL. Each value will be of typestruct xfs_log_item.- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_for_each_ail_log_item(mp: Value) Iterable[Value][source]¶
Iterates over the XFS Active Item Log and returns each item
- Parameters:
mp – The XFS mount to iterate. The value must be of type struct xfs_mount.
- Yields:
gdb.Value– A log item from AIL owned by this mount. The value will be of typestruct xfs_log_item.- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_for_each_ail_log_item_typed(mp: Value) Iterable[Value][source]¶
Iterates over the XFS Active Item Log and returns each item, resolved to the specific type.
- Parameters:
mp – The XFS mount to iterate. The value must be of type
struct xfs_mount.- Yields:
gdb.Value– Depending on type, the value will be any of the following types:struct xfs_buf_log_item_typestruct xfs_inode_log_item_typestruct xfs_efi_log_item_typestruct xfs_efd_log_item_typestruct xfs_dq_logitemint(for UNLINK item)
- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_format_xfsbuf(buf: Value) str[source]¶
Returns a human-readable format of
struct xfs_buf- Parameters:
buf – The
struct xfs_bufto decode. The value must be of typestruct xfs_buf.- Returns:
- The human-readable representation of the
struct xfs_buf.
- Return type:
str- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_inode(vfs_inode: Value, force: bool = False) Value[source]¶
Converts a VFS inode to a xfs inode
This method converts a
struct inodeto astruct xfs_inode.- Parameters:
vfs_inode – The
struct inodeto convert to astruct xfs_inodeThe value must be of typestruct inode.force – ignore type checking
- Returns:
The converted
struct xfs_inode. The value will be of typestruct xfs_inode.- Return type:
- Raises:
TypeError – The inode does not belong to xfs
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_log_item_typed(item: Value) Value[source]¶
Returns the log item converted from the generic type to the actual type
- Parameters:
item – The
struct xfs_log_itemto convert. The value must be of typestruct xfs_log_item.- Returns:
Depending on type, the value will be any of the following types:
struct xfs_buf_log_item_typestruct xfs_inode_log_item_typestruct xfs_efi_log_item_typestruct xfs_efd_log_item_typestruct xfs_dq_logitemint(forXFS_LI_IUNLINKitem)
- Return type:
- Raises:
RuntimeError – An unexpected item type was encountered
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_mount(sb: Value, force: bool = False) Value[source]¶
Converts a VFS superblock to a xfs mount
This method converts a
struct super_blockto astruct xfs_mount *- Parameters:
super_block – The struct super_block to convert to a
struct xfs_fs_info. The value must be of typestruct super_block.- Returns:
The converted
struct xfs_mount. The value will be of typestruct xfs_mount *.- Return type:
- Raises:
InvalidArgumentError – The
struct super_blockdoes not belong to xfsgdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_mount_flags(mp: Value) str[source]¶
Return the XFS-internal mount flags in string form
- Parameters:
mp – The
struct xfs_mountfor the file system. The value must be of typestruct xfs_mount.- Returns:
The mount flags in string form
- Return type:
str- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.xfs.xfs_mount_uuid(mp: Value) UUID[source]¶
Return the UUID for an XFS file system in string form
- Parameters:
mp – The
struct xfs_mountfor the file system. The value must be of typestruct xfs_mount.- Returns:
The Python UUID object that describes the xfs UUID
- Return type:
uuid.UUID- Raises:
gdb.NotAvailableError – The target value was not available.