Top | ![]() |
![]() |
![]() |
![]() |
#define | BD_BTRFS_MAIN_VOLUME_ID |
#define | BD_BTRFS_MIN_MEMBER_SIZE |
#define | BD_BTRFS_ERROR |
enum | BDBtrfsError |
BDBtrfsDeviceInfo | |
BDBtrfsSubvolumeInfo | |
BDBtrfsFilesystemInfo |
gboolean bd_btrfs_init ();
Initializes the plugin. **This function is called automatically by the library's initialization functions.**
void
bd_btrfs_close ();
Cleans up after the plugin. **This function is called automatically by the library's functions that unload it.**
void
bd_btrfs_device_info_free (BDBtrfsDeviceInfo *info
);
Frees info
.
[skip]
BDBtrfsDeviceInfo *
bd_btrfs_device_info_copy (BDBtrfsDeviceInfo *info
);
Creates a new copy of info
.
[skip]
void
bd_btrfs_subvolume_info_free (BDBtrfsSubvolumeInfo *info
);
Frees info
.
[skip]
BDBtrfsSubvolumeInfo *
bd_btrfs_subvolume_info_copy (BDBtrfsSubvolumeInfo *info
);
Creates a new copy of info
.
[skip]
void
bd_btrfs_filesystem_info_free (BDBtrfsFilesystemInfo *info
);
Frees info
.
[skip]
BDBtrfsFilesystemInfo *
bd_btrfs_filesystem_info_copy (BDBtrfsFilesystemInfo *info
);
Creates a new copy of info
.
[skip]
gboolean bd_btrfs_create_volume (const gchar **devices
,const gchar *label
,const gchar *data_level
,const gchar *md_level
,const BDExtraArg **extra
,GError **error
);
devices |
list of devices to create btrfs volume from. |
[array zero-terminated=1] |
label |
label for the volume. |
[allow-none] |
data_level |
RAID level for the data or |
[allow-none] |
md_level |
RAID level for the metadata or |
[allow-none] |
extra |
extra options for the volume creation (right now passed to the 'mkfs.btrfs' utility). |
[allow-none][array zero-terminated=1] |
error |
place to store error (if any). |
[out] |
gboolean bd_btrfs_add_device (const gchar *mountpoint
,const gchar *device
,const BDExtraArg **extra
,GError **error
);
gboolean bd_btrfs_remove_device (const gchar *mountpoint
,const gchar *device
,const BDExtraArg **extra
,GError **error
);
gboolean bd_btrfs_create_subvolume (const gchar *mountpoint
,const gchar *name
,const BDExtraArg **extra
,GError **error
);
gboolean bd_btrfs_delete_subvolume (const gchar *mountpoint
,const gchar *name
,const BDExtraArg **extra
,GError **error
);
guint64 bd_btrfs_get_default_subvolume_id (const gchar *mountpoint
,GError **error
);
gboolean bd_btrfs_set_default_subvolume (const gchar *mountpoint
,guint64 subvol_id
,const BDExtraArg **extra
,GError **error
);
mountpoint |
mountpoint of the volume to set the default subvolume ID of |
|
subvol_id |
ID of the subvolume to be set as the default subvolume |
|
extra |
extra options for the setting (right now passed to the 'btrfs' utility). |
[allow-none][array zero-terminated=1] |
error |
place to store error (if any). |
[out] |
gboolean bd_btrfs_create_snapshot (const gchar *source
,const gchar *dest
,gboolean ro
,const BDExtraArg **extra
,GError **error
);
BDBtrfsDeviceInfo ** bd_btrfs_list_devices (const gchar *device
,GError **error
);
device |
a device that is part of the queried btrfs volume |
|
error |
place to store error (if any). |
[out] |
information about the devices that are part of the btrfs volume
containing device
or NULL
in case of error.
[array zero-terminated=1]
BDBtrfsSubvolumeInfo ** bd_btrfs_list_subvolumes (const gchar *mountpoint
,gboolean snapshots_only
,GError **error
);
mountpoint |
a mountpoint of the queried btrfs volume |
|
snapshots_only |
whether to list only snapshot subvolumes or not |
|
error |
place to store error (if any). |
[out] |
information about the subvolumes that are part of the btrfs volume
mounted at mountpoint
or NULL
in case of error
The subvolumes are sorted in a way that no child subvolume appears in the list before its parent (sub)volume.
[array zero-terminated=1]
BDBtrfsFilesystemInfo * bd_btrfs_filesystem_info (const gchar *device
,GError **error
);
gboolean bd_btrfs_mkfs (const gchar **devices
,const gchar *label
,const gchar *data_level
,const gchar *md_level
,const BDExtraArg **extra
,GError **error
);
devices |
list of devices to create btrfs volume from. |
[array zero-terminated=1] |
label |
label for the volume. |
[allow-none] |
data_level |
RAID level for the data or |
[allow-none] |
md_level |
RAID level for the metadata or |
[allow-none] |
extra |
extra options for the volume creation (right now passed to the 'btrfs' utility). |
[allow-none][array zero-terminated=1] |
error |
place to store error (if any). |
[out] |
gboolean bd_btrfs_resize (const gchar *mountpoint
,guint64 size
,const BDExtraArg **extra
,GError **error
);
gboolean bd_btrfs_check (const gchar *device
,const BDExtraArg **extra
,GError **error
);
gboolean bd_btrfs_repair (const gchar *device
,const BDExtraArg **extra
,GError **error
);
gboolean bd_btrfs_change_label (const gchar *mountpoint
,const gchar *label
,GError **error
);
typedef struct { guint64 id; gchar *path; guint64 size; guint64 used; } BDBtrfsDeviceInfo;
typedef struct { guint64 id; guint64 parent_id; gchar *path; } BDBtrfsSubvolumeInfo;