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: gdb.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.
-
classmethod
-
class
crash.subsystem.filesystem.xfs.XFSBufBioDecoder(bio: gdb.Value)[source]¶ Bases:
crash.subsystem.storage.decoders.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: gdb.Value)[source]¶ Bases:
crash.subsystem.storage.decoders.DecoderDecodes a struct xfs_buf into human-readable form
-
crash.subsystem.filesystem.xfs.is_xfs_inode(vfs_inode: gdb.Value) → bool[source]¶ Tests whether a generic
struct inodebelongs to XFSParameters: 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: boolRaises: gdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.is_xfs_super(super_block: gdb.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: boolRaises: gdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.item_to_buf_log_item(item: gdb.Value) → gdb.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 notXFS_LI_BUFgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.item_to_dquot_log_item(item: gdb.Value) → gdb.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 notXFS_LI_DQUOTgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.item_to_efd_log_item(item: gdb.Value) → gdb.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 notXFS_LI_EFDgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.item_to_efi_log_item(item: gdb.Value) → gdb.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 notXFS_LI_EFIgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.item_to_inode_log_item(item: gdb.Value) → gdb.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 notXFS_LI_INODEgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.item_to_quotaoff_log_item(item: gdb.Value) → gdb.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_itemReturn type: Raises: InvalidArgumentError– The type of log item is notXFS_LI_QUOTAOFFgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.xfs_for_each_ail_entry(ail: gdb.Value) → Iterable[gdb.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: gdb.Value) → Iterable[gdb.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: gdb.Value) → Iterable[gdb.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: gdb.Value) → str[source]¶ Returns a human-readable format of
struct xfs_bufParameters: 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: strRaises: gdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.xfs_inode(vfs_inode: gdb.Value, force: bool = False) → gdb.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 xfsgdb.NotAvailableError– The target value was not available.
- vfs_inode – The
-
crash.subsystem.filesystem.xfs.xfs_log_item_typed(item: gdb.Value) → gdb.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 encounteredgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.xfs_mount(sb: gdb.Value, force: bool = False) → gdb.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– Thestruct super_blockdoes not belong to xfsgdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.xfs_mount_flags(mp: gdb.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: strRaises: gdb.NotAvailableError– The target value was not available.
-
crash.subsystem.filesystem.xfs.xfs_mount_uuid(mp: gdb.Value) → uuid.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.UUIDRaises: gdb.NotAvailableError– The target value was not available.