crash.subsystem.filesystem.mount module¶
The crash.subsystem.filesystem.mount module contains helpers used to access the file system namespace.
NOTE: Linux v3.3 split struct mount from struct vfsmount. Prior
kernels do not have struct mount. In functions documented as using a
gdb.Value describing a struct mount, a struct vfsmount
will be required and/or returned instead.
- class crash.subsystem.filesystem.mount.Mount[source]¶
Bases:
object
- crash.subsystem.filesystem.mount.d_path(mnt: Value, dentry: Value, root: Value = None) str[source]¶
Returns a file system path described by a mount and dentry
- Parameters:
mnt – The mount structure for the start of the path
dentry – The dentry for the start of the path. The value must be of type
struct dentry.root – The mount structure at which to stop resolution. If unspecified or
None, the current root of the namespace is used.
- Returns:
The path in string form
- Return type:
str- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.mount.for_each_mount(task: Value = None) Iterator[Value][source]¶
Iterate over each mountpoint in the namespace of the specified task
If no task is given, the
init_tasksymbol is used.The type of the mount structure returned depends on whether
struct mountexists on the kernel version being debugged structure.- Parameters:
task – The task which contains the namespace to iterate. The
gdb.Valuemust describe astruct task_struct. If unspecified, the value for theinit_tasksymbol will be used.- Yields:
gdb.Value– A mountpoint attached to the namespace. The value will be of typestruct mountstructure .- Raises:
gdb.NotAvailableError – The target value is not available.
- crash.subsystem.filesystem.mount.mount_device(mnt: Value) str[source]¶
Returns the device name that this mount is using
- Parameters:
mnt – The mount structure for which to get the device name
- Returns:
The device name in string form
- Return type:
str- Raises:
gdb.NotAvailableError – The target value was not available.
- crash.subsystem.filesystem.mount.mount_flags(mnt: Value, show_hidden: bool = False) str[source]¶
Returns the human-readable flags of the
struct mountstructure.- Parameters:
mnt – The mount structure for which to return flags
show_hidden – Whether to return hidden flags
- Returns:
The mount flags in human-readable form
- Return type:
str
- crash.subsystem.filesystem.mount.mount_fstype(mnt: Value) str[source]¶
Returns the file system type of the mount
- Parameters:
mnt – The mount structure for which to return the file system type
- Returns:
The file system type of the mount in string form
- Return type:
str
- crash.subsystem.filesystem.mount.mount_root(mnt: Value) Value[source]¶
Returns the struct dentry corresponding to the root of a mount
- Parameters:
mnt – The mount structure for which to return the root dentry
- Returns:
- The dentry that corresponds to the root of
the mount. The value will be of type
struct dentry.
- Return type:
- crash.subsystem.filesystem.mount.mount_super(mnt: Value) Value[source]¶
Returns the struct super_block associated with a mount
- Parameters:
mnt – The mount structure for which to return the super_block
- Returns:
- The super_block associated with the mount.
The value will be of type
struct super_block.
- Return type: