MountEntry

1. Overview

The MountEntry module provides restore mount mapping for BastionGuard Backup. It associates a Device with a target mount point and mount options and exposes BTRFS subvolume and LVM-related helpers.

The implementation is written in Vala and uses GLib/GIO together with the application utility namespaces required by the file.


2. Dependencies and Integration

The module imports:

  • TeeJee.Logging
  • TeeJee.FileSystem
  • TeeJee.JsonHelper
  • TeeJee.ProcessHelper
  • TeeJee.GtkHelper
  • TeeJee.System
  • TeeJee.Misc
  • Json

Key runtime integrations include:

  • JSON-GLib – structured configuration or metadata serialization
  • Gee – typed lists, maps, queues, or collection operations

3. Declared Types

3.1 MountEntry

public class MountEntry : GLib.Object

This class encapsulates the state and operations described by this source file.


4. State, Properties, Constants, and Signals

Public and protected state

  • public Device device – Kernel or canonical device path.
  • public string mount_point – Filesystem mount location.
  • public string mount_options – Runtime state used by the module.

5. Public API and Operational Methods

5.1 MountEntry()

public MountEntry(Device? device, string mount_point, string mount_options)

Initializes the object state, allocates required collections or widgets, and applies constructor parameters.

5.2 subvolume_name()

public string subvolume_name()

Implements the subvolume name operation for this module.

5.3 lvm_name()

public string lvm_name()

Implements the lvm name operation for this module.

5.4 find_entry_by_mount_point()

public static MountEntry? find_entry_by_mount_point(Gee.ArrayList<MountEntry> entries, string mount_path)

Searches for entry by mount point and returns the matching object or value.


6. Operational Flow

  1. Expose the module data or constant text to the caller.

7. Error Handling and Diagnostics

  • Boolean, nullable, or empty-string return values communicate recoverable failures to callers.

8. Runtime and Security Considerations

  • Shared state: static caches and global switches are shared by all callers and are not automatically thread-isolated.

9. Licensing

The source is distributed under the license terms declared in the source header.