libstorage-ng
Loading...
Searching...
No Matches
storage::MountPoint Class Reference

Class to represent a mount point. More...

#include <MountPoint.h>

Inheritance diagram for storage::MountPoint:
[legend]
Collaboration diagram for storage::MountPoint:
[legend]

Public Member Functions

const std::string & get_path () const
void set_path (const std::string &path)
bool is_rootprefixed () const
 Return whether the path of the mount point will be prefixed with the rootprefix during mount operations.
void set_rootprefixed (bool rootprefixed)
 Sets whether the path is rootprefixed.
MountByType get_mount_by () const
 Get the mount-by method.
void set_mount_by (MountByType mount_by)
 Set the mount-by method.
void set_default_mount_by ()
 Set the mount-by method to the global default, see Storage::get_default_mount_by().
std::vector< MountByTypepossible_mount_bys () const
 Returns the possible mount-by methods for the mount point.
const std::vector< std::string > & get_mount_options () const
 Get the mount options.
void set_mount_options (const std::vector< std::string > &mount_options)
 Set the mount options.
std::vector< std::string > default_mount_options () const
 Default mount options.
void set_default_mount_options ()
 Set the mount options to the default mount options.
FsType get_mount_type () const
 Get the filesystem type used to mount the device, as specified in fstab(5) and/or in the mount(8) command.
void set_mount_type (FsType mount_type)
 Set the filesystem type to be used to mount the device.
int get_freq () const
 Get the freq field from fstab(5).
void set_freq (int freq)
 Set the freq field.
int get_passno () const
 Get the passno field from fstab(5).
void set_passno (int passno)
bool is_active () const
 Return whether the mount point is active (mounted).
void set_active (bool active)
 Sets whether the mount point is active (mounted).
bool is_in_etc_fstab () const
 Query whether the mount point is present (probed devicegraph) or will be present (staging devicegraph) in /etc/fstab.
void set_in_etc_fstab (bool in_etc_fstab)
 Set whether the mount point will be present in /etc/fstab.
bool has_mountable () const
 Checks whether the mount point has a mountable.
Mountableget_mountable ()
 Return the mountable of the mount point.
const Mountableget_mountable () const
 Return the mountable of the mount point.
Filesystemget_filesystem ()
 Return the filesystem of mountable of the mount point.
const Filesystemget_filesystem () const
 Return the filesystem of mountable of the mount point.
void immediate_activate ()
 Immediately activate (mount) the mount point.
void immediate_deactivate ()
 Immediately deactivate (unmount) the mount point object.
Impl & get_impl ()
const Impl & get_impl () const
virtual MountPointclone () const override
 MountPoint (Impl *impl)
Public Member Functions inherited from storage::Device
sid_t get_sid () const
 Return the storage id (sid) of the device.
bool operator== (const Device &rhs) const
bool operator!= (const Device &rhs) const
Devicecopy_to_devicegraph (Devicegraph *devicegraph) const
 Copies the device to the devicegraph.
bool exists_in_devicegraph (const Devicegraph *devicegraph) const
 Checks if the device exists in the devicegraph.
bool exists_in_probed () const
 Checks if the device exists in the probed devicegraph.
bool exists_in_staging () const
 Checks if the device exists in the staging devicegraph.
bool exists_in_system () const
 Checks if the device exists in the system devicegraph.
std::string get_displayname () const
ResizeInfo detect_resize_info () const
 Detect the resize info of the device.
bool has_children () const
size_t num_children () const
bool has_parents () const
size_t num_parents () const
std::vector< Device * > get_children ()
std::vector< const Device * > get_children () const
std::vector< Device * > get_children (View view)
 Get all children of the device.
std::vector< const Device * > get_children (View view) const
 Get all children of the device.
std::vector< Device * > get_parents ()
std::vector< const Device * > get_parents () const
std::vector< Device * > get_parents (View view)
 Get all parents of the device.
std::vector< const Device * > get_parents (View view) const
 Get all parents of the device.
std::vector< Device * > get_siblings (bool itself)
std::vector< const Device * > get_siblings (bool itself) const
std::vector< Device * > get_descendants (bool itself)
std::vector< const Device * > get_descendants (bool itself) const
std::vector< Device * > get_descendants (bool itself, View view)
std::vector< const Device * > get_descendants (bool itself, View view) const
std::vector< Device * > get_ancestors (bool itself)
std::vector< const Device * > get_ancestors (bool itself) const
std::vector< Device * > get_leaves (bool itself)
std::vector< const Device * > get_leaves (bool itself) const
std::vector< Device * > get_roots (bool itself)
std::vector< const Device * > get_roots (bool itself) const
std::vector< Holder * > get_in_holders ()
std::vector< const Holder * > get_in_holders () const
std::vector< Holder * > get_out_holders ()
std::vector< const Holder * > get_out_holders () const
void remove_descendants () ST_DEPRECATED
void remove_descendants (View view)
 Remove all descendants of the device.
const std::map< std::string, std::string > & get_userdata () const
 Return the userdata of the device.
void set_userdata (const std::map< std::string, std::string > &userdata)
 Set the userdata of the device.
std::string get_name_sort_key () const
 Get a sort-key based on the device name.
Devicegraphget_devicegraph ()
 Return the devicegraph the device belongs to.
const Devicegraphget_devicegraph () const
 Return the devicegraph the device belongs to.
Impl & get_impl ()
const Impl & get_impl () const
void save (xmlNode *node) const ST_DEPRECATED

Static Public Member Functions

static MountPointcreate (Devicegraph *devicegraph, const std::string &path)
static MountPointload (Devicegraph *devicegraph, const xmlNode *node)
static std::vector< MountPoint * > get_all (Devicegraph *devicegraph)
 Get all MountPoints.
static std::vector< const MountPoint * > get_all (const Devicegraph *devicegraph)
 Get all MountPoints.
static std::string normalize_path (const std::string &path)
 Return normalized form of path.
static std::vector< const MountPoint * > find_by_path (const Devicegraph *devicegraph, const std::string &path)
 Find all MountPoints with path.
Static Public Member Functions inherited from storage::Device
static std::vector< Device * > get_all (Devicegraph *devicegraph)
 Get all Devices.
static std::vector< const Device * > get_all (const Devicegraph *devicegraph)
 Get all Devices.
static bool compare_by_sid (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by sid.
static bool compare_by_name (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by name.

Additional Inherited Members

Protected Member Functions inherited from storage::Device
 Device (Impl *impl)
void create (Devicegraph *devicegraph) ST_DEPRECATED
 Create a device in the devicegraph.
void load (Devicegraph *devicegraph) ST_DEPRECATED

Detailed Description

Class to represent a mount point.

Member Function Documentation

◆ clone()

virtual MountPoint * storage::MountPoint::clone ( ) const
overridevirtual

Implements storage::Device.

◆ create()

MountPoint * storage::MountPoint::create ( Devicegraph * devicegraph,
const std::string & path )
static

◆ default_mount_options()

std::vector< std::string > storage::MountPoint::default_mount_options ( ) const

Default mount options.

So far the default mount options only contain the subvol for btrfs subvolumes.

◆ get_all()

std::vector< const MountPoint * > storage::MountPoint::get_all ( const Devicegraph * devicegraph)
static

Get all MountPoints.

◆ get_filesystem() [1/2]

Filesystem * storage::MountPoint::get_filesystem ( )

Return the filesystem of mountable of the mount point.

Exceptions
Exception

◆ get_filesystem() [2/2]

const Filesystem * storage::MountPoint::get_filesystem ( ) const

Return the filesystem of mountable of the mount point.

Exceptions
Exception

◆ get_freq()

int storage::MountPoint::get_freq ( ) const

Get the freq field from fstab(5).

The freq field is used by the dump(8) command to determine which filesystems need to be dumped. The field is likely obsolete.

◆ get_mountable() [1/2]

Mountable * storage::MountPoint::get_mountable ( )

Return the mountable of the mount point.

Exceptions
Exception

◆ get_mountable() [2/2]

const Mountable * storage::MountPoint::get_mountable ( ) const

Return the mountable of the mount point.

Exceptions
Exception

◆ get_passno()

int storage::MountPoint::get_passno ( ) const

Get the passno field from fstab(5).

The passno field is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time.

◆ has_mountable()

bool storage::MountPoint::has_mountable ( ) const

Checks whether the mount point has a mountable.

This is usually true unless the devicegraph is broken.

◆ immediate_activate()

void storage::MountPoint::immediate_activate ( )

Immediately activate (mount) the mount point.

In contrast to set_active() this function acts immediately and does not require calling commit().

The mount point object must exist in the probed devicegraph.

Exceptions
Exception

◆ immediate_deactivate()

void storage::MountPoint::immediate_deactivate ( )

Immediately deactivate (unmount) the mount point object.

In contrast to set_active() this function acts immediately and does not require calling commit().

The mount point object must exist in the probed devicegraph.

Exceptions
Exception

◆ is_rootprefixed()

bool storage::MountPoint::is_rootprefixed ( ) const

Return whether the path of the mount point will be prefixed with the rootprefix during mount operations.

The default value is true (for historic reasons).

See also
Environment::get_rootprefix()

◆ possible_mount_bys()

std::vector< MountByType > storage::MountPoint::possible_mount_bys ( ) const

Returns the possible mount-by methods for the mount point.

LABEL is included even if the filesystem label is not set.

Exceptions
Exception

◆ set_default_mount_options()

void storage::MountPoint::set_default_mount_options ( )

Set the mount options to the default mount options.

See also
default_mount_options()

◆ set_freq()

void storage::MountPoint::set_freq ( int freq)

Set the freq field.

See also
get_freq()

◆ set_mount_options()

void storage::MountPoint::set_mount_options ( const std::vector< std::string > & mount_options)

Set the mount options.

Avoid overriding the subvol option for btrfs subvolumes unless you are certain what you are doing.

◆ set_mount_type()

void storage::MountPoint::set_mount_type ( FsType mount_type)

Set the filesystem type to be used to mount the device.

Setting the filesystem type to FsType::UNKNOWN is not allowed.

Exceptions
Exception

◆ set_passno()

void storage::MountPoint::set_passno ( int passno)
See also
get_passno()

◆ set_path()

void storage::MountPoint::set_path ( const std::string & path)

◆ set_rootprefixed()

void storage::MountPoint::set_rootprefixed ( bool rootprefixed)

Sets whether the path is rootprefixed.

See also
is_rootprefixed()

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/libstorage-ng-4.5.263-build/libstorage-ng-4.5.263/storage/Filesystems/MountPoint.h