Blame src/lib/plugin_apis/fs.h

Packit Service 158247
#include <glib.h>
Packit Service 158247
#include <glib-object.h>
Packit Service 158247
#include <blockdev/utils.h>
Packit Service 158247
Packit Service 158247
Packit Service 158247
#ifndef BD_FS_API
Packit Service 158247
#define BD_FS_API
Packit Service 158247
Packit Service 158247
GQuark  bd_fs_error_quark (void);
Packit Service 158247
Packit Service 158247
Packit Service 158247
#define BD_FS_ERROR bd_fs_error_quark ()
Packit Service 158247
typedef enum {
Packit Service 158247
    BD_FS_ERROR_INVAL,
Packit Service 158247
    BD_FS_ERROR_PARSE,
Packit Service 158247
    BD_FS_ERROR_FAIL,
Packit Service 158247
    BD_FS_ERROR_NOFS,
Packit Service 158247
    BD_FS_ERROR_PIPE,
Packit Service 158247
    BD_FS_ERROR_UNMOUNT_FAIL,
Packit Service 158247
    BD_FS_ERROR_NOT_SUPPORTED,
Packit Service 158247
    BD_FS_ERROR_NOT_MOUNTED,
Packit Service 158247
    BD_FS_ERROR_AUTH,
Packit Service 158247
    BD_FS_ERROR_TECH_UNAVAIL,
Packit Service 158247
} BDFsError;
Packit Service 158247
Packit Service 158247
#define BD_FS_TYPE_EXT2_INFO (bd_fs_ext2_info_get_type ())
Packit Service 158247
GType  bd_fs_ext2_info_get_type ();
Packit Service 158247
Packit Service 158247
#define BD_FS_TYPE_EXT3_INFO (bd_fs_ext3_info_get_type ())
Packit Service 158247
GType  bd_fs_ext3_info_get_type ();
Packit Service 158247
Packit Service 158247
#define BD_FS_TYPE_EXT4_INFO (bd_fs_ext4_info_get_type ())
Packit Service 158247
GType  bd_fs_ext4_info_get_type ();
Packit Service 158247
Packit Service 158247
Packit Service 158247
typedef struct BDFSExtInfo {
Packit Service 158247
    gchar *label;
Packit Service 158247
    gchar *uuid;
Packit Service 158247
    gchar *state;
Packit Service 158247
    guint64 block_size;
Packit Service 158247
    guint64 block_count;
Packit Service 158247
    guint64 free_blocks;
Packit Service 158247
} BDFSExtInfo;
Packit Service 158247
Packit Service 158247
typedef struct BDFSExtInfo BDFSExt4Info;
Packit Service 158247
typedef struct BDFSExtInfo BDFSExt3Info;
Packit Service 158247
typedef struct BDFSExtInfo BDFSExt2Info;
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * BDFSExtInfo:
Packit Service 158247
 * @label: label of the filesystem
Packit Service 158247
 * @uuid: uuid of the filesystem
Packit Service 158247
 * @state: state of the filesystem (e.g. "clean")
Packit Service 158247
 * @block_size: block size used by the filesystem
Packit Service 158247
 * @block_count: number of blocks in the filesystem
Packit Service 158247
 * @free_blocks: number of free blocks in the filesystem
Packit Service 158247
 */
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_info_copy: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Creates a new copy of @data.
Packit Service 158247
 */
Packit Service 158247
BDFSExt2Info* bd_fs_ext2_info_copy (BDFSExt2Info *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_info_copy: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Creates a new copy of @data.
Packit Service 158247
 */
Packit Service 158247
BDFSExt3Info* bd_fs_ext3_info_copy (BDFSExt3Info *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_info_copy: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Creates a new copy of @data.
Packit Service 158247
 */
Packit Service 158247
BDFSExt4Info* bd_fs_ext4_info_copy (BDFSExt4Info *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_info_free: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Frees @data.
Packit Service 158247
 */
Packit Service 158247
void  bd_fs_ext3_info_free (BDFSExt3Info *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_info_free: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Frees @data.
Packit Service 158247
 */
Packit Service 158247
void  bd_fs_ext4_info_free (BDFSExt4Info *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
Packit Service 158247
Packit Service 158247
Packit Service 158247
#define BD_FS_TYPE_XFS_INFO (bd_fs_xfs_info_get_type ())
Packit Service 158247
GType  bd_fs_xfs_info_get_type ();
Packit Service 158247
Packit Service 158247
Packit Service 158247
typedef struct BDFSXfsInfo {
Packit Service 158247
    gchar *label;
Packit Service 158247
    gchar *uuid;
Packit Service 158247
    guint64 block_size;
Packit Service 158247
    guint64 block_count;
Packit Service 158247
} BDFSXfsInfo;
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * BDFSXfsInfo:
Packit Service 158247
 * @label: label of the filesystem
Packit Service 158247
 * @uuid: uuid of the filesystem
Packit Service 158247
 * @block_size: block size used by the filesystem
Packit Service 158247
 * @block_count: number of blocks in the filesystem
Packit Service 158247
 */
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_info_copy: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Creates a new copy of @data.
Packit Service 158247
 */
Packit Service 158247
BDFSXfsInfo* bd_fs_xfs_info_copy (BDFSXfsInfo *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_info_free: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Frees @data.
Packit Service 158247
 */
Packit Service 158247
void  bd_fs_xfs_info_free (BDFSXfsInfo *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
Packit Service 158247
#define BD_FS_TYPE_VFAT_INFO (bd_fs_vfat_info_get_type ())
Packit Service 158247
GType  bd_fs_vfat_info_get_type ();
Packit Service 158247
Packit Service 158247
Packit Service 158247
typedef struct BDFSVfatInfo {
Packit Service 158247
    gchar *label;
Packit Service 158247
    gchar *uuid;
Packit Service 158247
    guint64 cluster_size;
Packit Service 158247
    guint64 cluster_count;
Packit Service 158247
    guint64 free_cluster_count;
Packit Service 158247
} BDFSVfatInfo;
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * BDFSVfatInfo:
Packit Service 158247
 * @label: label of the filesystem
Packit Service 158247
 * @uuid: uuid of the filesystem
Packit Service 158247
 * @cluster_size: cluster size used by the filesystem
Packit Service 158247
 * @cluster_count: number of clusters in the filesystem
Packit Service 158247
 * @free_cluster_count: number of free clusters in the filesystem
Packit Service 158247
 */
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_info_copy: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Creates a new copy of @data.
Packit Service 158247
 */
Packit Service 158247
BDFSVfatInfo* bd_fs_vfat_info_copy (BDFSVfatInfo *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_info_free: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Frees @data.
Packit Service 158247
 */
Packit Service 158247
void  bd_fs_vfat_info_free (BDFSVfatInfo *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
Packit Service 158247
typedef struct BDFSNtfsInfo {
Packit Service 158247
    guint64 size;
Packit Service 158247
    guint64 free_space;
Packit Service 158247
} BDFSNtfsInfo;
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * BDFSNtfsInfo:
Packit Service 158247
 * @size: size of the filesystem in bytes
Packit Service 158247
 * @free_space: number of free space in the filesystem in bytes
Packit Service 158247
 */
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_info_copy: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Creates a new copy of @data.
Packit Service 158247
 */
Packit Service 158247
BDFSNtfsInfo* bd_fs_ntfs_info_copy (BDFSNtfsInfo *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_info_free: (skip)
Packit Service 158247
 *
Packit Service 158247
 * Frees @data.
Packit Service 158247
 */
Packit Service 158247
void  bd_fs_ntfs_info_free (BDFSNtfsInfo *data);
Packit Service 158247
Packit Service 158247
Packit Service 158247
GType  bd_fs_ntfs_info_get_type ();
Packit Service 158247
Packit Service 158247
Packit Service 158247
typedef enum {
Packit Service 158247
    BD_FS_TECH_GENERIC = 0,
Packit Service 158247
    BD_FS_TECH_MOUNT,
Packit Service 158247
    BD_FS_TECH_EXT2,
Packit Service 158247
    BD_FS_TECH_EXT3,
Packit Service 158247
    BD_FS_TECH_EXT4,
Packit Service 158247
    BD_FS_TECH_XFS,
Packit Service 158247
    BD_FS_TECH_VFAT,
Packit Service 158247
    BD_FS_TECH_NTFS
Packit Service 158247
} BDFSTech;
Packit Service 158247
Packit Service 158247
typedef enum {
Packit Service 158247
    BD_FS_TECH_MODE_MKFS      = 1 << 0,
Packit Service 158247
    BD_FS_TECH_MODE_WIPE      = 1 << 1,
Packit Service 158247
    BD_FS_TECH_MODE_CHECK     = 1 << 2,
Packit Service 158247
    BD_FS_TECH_MODE_REPAIR    = 1 << 3,
Packit Service 158247
    BD_FS_TECH_MODE_SET_LABEL = 1 << 4,
Packit Service 158247
    BD_FS_TECH_MODE_QUERY     = 1 << 5,
Packit Service 158247
    BD_FS_TECH_MODE_RESIZE    = 1 << 6,
Packit Service 158247
} BDFSTechMode;
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_is_tech_avail:
Packit Service 158247
 * @tech: the queried tech
Packit Service 158247
 * @mode: a bit mask of queried modes of operation (#BDFSTechMode) for @tech
Packit Service 158247
 * @error: (out): place to store error (details about why the @tech-@mode combination is not available)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the @tech-@mode combination is available -- supported by the
Packit Service 158247
 *          plugin implementation and having all the runtime dependencies available
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_is_tech_avail (BDFSTech tech, guint64 mode, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_wipe:
Packit Service 158247
 * @device: the device to wipe signatures from
Packit Service 158247
 * @all: whether to wipe all (%TRUE) signatures or just the first (%FALSE) one
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Note: This function will wipe signatures on a mounted @device without
Packit Service 158247
 *       asking. Use %bd_fs_wipe_force if you want to control this
Packit Service 158247
 *       behaviour manually.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether signatures were successfully wiped on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_wipe (const gchar *device, gboolean all, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_wipe_force:
Packit Service 158247
 * @device: the device to wipe signatures from
Packit Service 158247
 * @all: whether to wipe all (%TRUE) signatures or just the first (%FALSE) one
Packit Service 158247
 * @force: whether to force wipe even if the filesystem is mounted
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether signatures were successfully wiped on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_wipe_force (const gchar *device, gboolean all, gboolean force, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_clean:
Packit Service 158247
 * @device: the device to clean
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Clean all signatures from @device.
Packit Service 158247
 * Difference between this and bd_fs_wipe() is that this function doesn't
Packit Service 158247
 * return error if @device is already empty. This will also always remove
Packit Service 158247
 * all signatures from @device, not only the first one.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether @device was successfully cleaned or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_clean (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_get_fstype:
Packit Service 158247
 * @device: the device to probe
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Get first signature on @device as a string.
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): type of filesystem found on @device, %NULL in case
Packit Service 158247
 *                           no signature has been detected or in case of error
Packit Service 158247
 *                           (@error is set in this case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
gchar* bd_fs_get_fstype (const gchar *device,  GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_freeze:
Packit Service 158247
 * @mountpoint: mountpoint of the device (filesystem) to freeze
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Freezes filesystem mounted on @mountpoint. The filesystem must
Packit Service 158247
 * support freezing.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether @mountpoint was successfully freezed or not
Packit Service 158247
 *
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_freeze (const gchar *mountpoint, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_unfreeze:
Packit Service 158247
 * @mountpoint: mountpoint of the device (filesystem) to un-freeze
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Un-freezes filesystem mounted on @mountpoint. The filesystem must
Packit Service 158247
 * support freezing.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether @mountpoint was successfully unfreezed or not
Packit Service 158247
 *
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_unfreeze (const gchar *mountpoint, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_unmount:
Packit Service 158247
 * @spec: mount point or device to unmount
Packit Service 158247
 * @lazy: enable/disable lazy unmount
Packit Service 158247
 * @force: enable/disable force unmount
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the unmount
Packit Service 158247
 *                                                 currently only 'run_as_uid'
Packit Service 158247
 *                                                 and 'run_as_gid' are supported
Packit Service 158247
 *                                                 value must be a valid non zero
Packit Service 158247
 *                                                 uid (gid)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether @spec was successfully unmounted or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_MOUNT (no mode, ignored)
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_unmount (const gchar *spec, gboolean lazy, gboolean force, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_mount:
Packit Service 158247
 * @device: (allow-none): device to mount, if not specified @mountpoint entry
Packit Service 158247
 *                        from fstab will be used
Packit Service 158247
 * @mountpoint: (allow-none): mountpoint for @device, if not specified @device
Packit Service 158247
 *                            entry from fstab will be used
Packit Service 158247
 * @fstype: (allow-none): filesystem type
Packit Service 158247
 * @options: (allow-none): comma delimited options for mount
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the unmount
Packit Service 158247
 *                                                 currently only 'run_as_uid'
Packit Service 158247
 *                                                 and 'run_as_gid' are supported
Packit Service 158247
 *                                                 value must be a valid non zero
Packit Service 158247
 *                                                 uid (gid)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether @device (or @mountpoint) was successfully mounted or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_MOUNT (no mode, ignored)
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_mount (const gchar *device, const gchar *mountpoint, const gchar *fstype, const gchar *options, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_get_mountpoint:
Packit Service 158247
 * @device: device to find mountpoint for
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Get mountpoint for @device. If @device is mounted multiple times only
Packit Service 158247
 * one mountpoint will be returned.
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): mountpoint for @device, %NULL in case device is
Packit Service 158247
 *                           not mounted or in case of an error (@error is set
Packit Service 158247
 *                           in this case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_MOUNT (no mode, ignored)
Packit Service 158247
 */
Packit Service 158247
gchar* bd_fs_get_mountpoint (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_is_mountpoint:
Packit Service 158247
 * @path: path (folder) to check
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether @path is a mountpoint or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_MOUNT (no mode, ignored)
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_is_mountpoint (const gchar *path, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_resize:
Packit Service 158247
 * @device: the device the file system of which to resize
Packit Service 158247
 * @new_size: new requested size for the file system (if 0, the file system is
Packit Service 158247
 *            adapted to the underlying block device)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_resize (const gchar *device, guint64 new_size, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
 /**
Packit Service 158247
 * bd_fs_repair:
Packit Service 158247
 * @device: the device the file system of which to repair
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Repair filesystem on @device. This calls other fs repair functions from this
Packit Service 158247
 * plugin based on detected filesystem (e.g. bd_fs_xfs_repair for XFS). This
Packit Service 158247
 * function will return an error for unknown/unsupported filesystems.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully repaired or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_repair (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_check:
Packit Service 158247
 * @device: the device the file system of which to check
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Check filesystem on @device. This calls other fs check functions from this
Packit Service 158247
 * plugin based on detected filesystem (e.g. bd_fs_xfs_check for XFS). This
Packit Service 158247
 * function will return an error for unknown/unsupported filesystems.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device passed the consistency check or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_check (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_set_label:
Packit Service 158247
 * @device: the device with file system to set the label for
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Set label for filesystem on @device. This calls other fs label functions from this
Packit Service 158247
 * plugin based on detected filesystem (e.g. bd_fs_xfs_set_label for XFS). This
Packit Service 158247
 * function will return an error for unknown/unsupported filesystems.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully relabled or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
typedef enum {
Packit Service 158247
    BD_FS_OFFLINE_SHRINK = 1 << 1,
Packit Service 158247
    BD_FS_OFFLINE_GROW = 1 << 2,
Packit Service 158247
    BD_FS_ONLINE_SHRINK = 1 << 3,
Packit Service 158247
    BD_FS_ONLINE_GROW = 1 << 4
Packit Service 158247
} BDFsResizeFlags;
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * BDFsResizeFlags:
Packit Service 158247
 * Flags indicating whether a filesystem resize action supports growing and/or
Packit Service 158247
 * shrinking if mounted or unmounted.
Packit Service 158247
 */
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_can_resize:
Packit Service 158247
 * @type: the filesystem type to be tested for installed resize support
Packit Service 158247
 * @mode: (out): flags for allowed resizing (i.e. growing/shrinking support for online/offline)
Packit Service 158247
 * @required_utility: (out) (transfer full): the utility binary which is required for resizing (if missing i.e. returns FALSE but no error)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Searches for the required utility to resize the given filesystem and returns whether
Packit Service 158247
 * it is installed. The mode flags indicate if growing and/or shrinking resize is available if
Packit Service 158247
 * mounted/unmounted.
Packit Service 158247
 * Unknown filesystems or filesystems which do not support resizing result in errors.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether filesystem resize is available
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_can_resize (const gchar *type, BDFsResizeFlags *mode, gchar **required_utility, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_can_check:
Packit Service 158247
 * @type: the filesystem type to be tested for installed consistency check support
Packit Service 158247
 * @required_utility: (out) (transfer full): the utility binary which is required for checking (if missing i.e. returns FALSE but no error)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Searches for the required utility to check the given filesystem and returns whether
Packit Service 158247
 * it is installed.
Packit Service 158247
 * Unknown filesystems or filesystems which do not support checking result in errors.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether filesystem check is available
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_can_check (const gchar *type, gchar **required_utility, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_can_repair:
Packit Service 158247
 * @type: the filesystem type to be tested for installed repair support
Packit Service 158247
 * @required_utility: (out) (transfer full): the utility binary which is required for repairing (if missing i.e. return FALSE but no error)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Searches for the required utility to repair the given filesystem and returns whether
Packit Service 158247
 * it is installed.
Packit Service 158247
 * Unknown filesystems or filesystems which do not support reparing result in errors.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether filesystem repair is available
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_can_repair (const gchar *type, gchar **required_utility, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_can_set_label:
Packit Service 158247
 * @type: the filesystem type to be tested for installed label support
Packit Service 158247
 * @required_utility: (out) (transfer full): the utility binary which is required for relabeling (if missing i.e. return FALSE but no error)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Searches for the required utility to set the label of the given filesystem and returns whether
Packit Service 158247
 * it is installed.
Packit Service 158247
 * Unknown filesystems or filesystems which do not support setting the label result in errors.
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether setting filesystem label is available
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_GENERIC-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_can_set_label (const gchar *type, gchar **required_utility, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_mkfs:
Packit Service 158247
 * @device: the device to create a new ext2 fs on
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
Packit Service 158247
 *                                                 passed to the 'mke2fs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether a new ext2 fs was successfully created on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_MKFS
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext2_mkfs (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_mkfs:
Packit Service 158247
 * @device: the device to create a new ext3 fs on
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
Packit Service 158247
 *                                                 passed to the 'mke2fs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether a new ext3 fs was successfully created on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_MKFS
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext3_mkfs (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_mkfs:
Packit Service 158247
 * @device: the device to create a new ext4 fs on
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
Packit Service 158247
 *                                                 passed to the 'mkfs.ext4' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether a new ext4 fs was successfully created on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT4-%BD_FS_TECH_MODE_MKFS
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext4_mkfs (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_wipe:
Packit Service 158247
 * @device: the device to wipe an ext2 signature from
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext2 signature was successfully wiped from the @device or
Packit Service 158247
 *          not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext2_wipe (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_wipe:
Packit Service 158247
 * @device: the device to wipe an ext3 signature from
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext3 signature was successfully wiped from the @device or
Packit Service 158247
 *          not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext3_wipe (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_wipe:
Packit Service 158247
 * @device: the device to wipe an ext4 signature from
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext4 signature was successfully wiped from the @device or
Packit Service 158247
 *          not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT4-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext4_wipe (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_check:
Packit Service 158247
 * @device: the device the file system on which to check
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the check (right now
Packit Service 158247
 *                                                 passed to the 'e2fsck' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext2 file system on the @device is clean or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext2_check (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_check:
Packit Service 158247
 * @device: the device the file system on which to check
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the check (right now
Packit Service 158247
 *                                                 passed to the 'e2fsck' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext3 file system on the @device is clean or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext3_check (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_check:
Packit Service 158247
 * @device: the device the file system on which to check
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the check (right now
Packit Service 158247
 *                                                 passed to the 'e2fsck' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext4 file system on the @device is clean or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT4-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext4_check (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_repair:
Packit Service 158247
 * @device: the device the file system on which to repair
Packit Service 158247
 * @unsafe: whether to do unsafe operations too
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the repair (right now
Packit Service 158247
 *                                                 passed to the 'e2fsck' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext2 file system on the @device was successfully repaired
Packit Service 158247
 *          (if needed) or not (error is set in that case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext2_repair (const gchar *device, gboolean unsafe, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_repair:
Packit Service 158247
 * @device: the device the file system on which to repair
Packit Service 158247
 * @unsafe: whether to do unsafe operations too
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the repair (right now
Packit Service 158247
 *                                                 passed to the 'e2fsck' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext3 file system on the @device was successfully repaired
Packit Service 158247
 *          (if needed) or not (error is set in that case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext3_repair (const gchar *device, gboolean unsafe, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_repair:
Packit Service 158247
 * @device: the device the file system on which to repair
Packit Service 158247
 * @unsafe: whether to do unsafe operations too
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the repair (right now
Packit Service 158247
 *                                                 passed to the 'e2fsck' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ext4 file system on the @device was successfully repaired
Packit Service 158247
 *          (if needed) or not (error is set in that case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT4-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext4_repair (const gchar *device, gboolean unsafe, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_set_label:
Packit Service 158247
 * @device: the device the file system on which to set label for
Packit Service 158247
 * @label: label to set
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the label of ext2 file system on the @device was
Packit Service 158247
 *          successfully set or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext2_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_set_label:
Packit Service 158247
 * @device: the device the file system on which to set label for
Packit Service 158247
 * @label: label to set
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the label of ext3 file system on the @device was
Packit Service 158247
 *          successfully set or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext3_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_set_label:
Packit Service 158247
 * @device: the device the file system on which to set label for
Packit Service 158247
 * @label: label to set
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the label of ext4 file system on the @device was
Packit Service 158247
 *          successfully set or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext4_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_get_info:
Packit Service 158247
 * @device: the device the file system of which to get info for
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): information about the file system on @device or
Packit Service 158247
 *                           %NULL in case of error
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
BDFSExt2Info* bd_fs_ext2_get_info (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_get_info:
Packit Service 158247
 * @device: the device the file system of which to get info for
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): information about the file system on @device or
Packit Service 158247
 *                           %NULL in case of error
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
BDFSExt3Info* bd_fs_ext3_get_info (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_get_info:
Packit Service 158247
 * @device: the device the file system of which to get info for
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): information about the file system on @device or
Packit Service 158247
 *                           %NULL in case of error
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
BDFSExt4Info* bd_fs_ext4_get_info (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext2_resize:
Packit Service 158247
 * @device: the device the file system of which to resize
Packit Service 158247
 * @new_size: new requested size for the file system (if 0, the file system is
Packit Service 158247
 *            adapted to the underlying block device)
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the resize (right now
Packit Service 158247
 *                                                 passed to the 'resize2fs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT2-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext2_resize (const gchar *device, guint64 new_size, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext3_resize:
Packit Service 158247
 * @device: the device the file system of which to resize
Packit Service 158247
 * @new_size: new requested size for the file system (if 0, the file system is
Packit Service 158247
 *            adapted to the underlying block device)
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the resize (right now
Packit Service 158247
 *                                                 passed to the 'resize2fs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT3-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext3_resize (const gchar *device, guint64 new_size, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ext4_resize:
Packit Service 158247
 * @device: the device the file system of which to resize
Packit Service 158247
 * @new_size: new requested size for the file system (if 0, the file system is
Packit Service 158247
 *            adapted to the underlying block device)
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the resize (right now
Packit Service 158247
 *                                                 passed to the 'resize2fs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_EXT4-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ext4_resize (const gchar *device, guint64 new_size, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_mkfs:
Packit Service 158247
 * @device: the device to create a new xfs fs on
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
Packit Service 158247
 *                                                 passed to the 'mkfs.xfs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether a new xfs fs was successfully created on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_MKFS
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_xfs_mkfs (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_wipe:
Packit Service 158247
 * @device: the device to wipe an xfs signature from
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an xfs signature was successfully wiped from the @device or
Packit Service 158247
 *          not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_xfs_wipe (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_check:
Packit Service 158247
 * @device: the device containing the file system to check
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an xfs file system on the @device is clean or not
Packit Service 158247
 *
Packit Service 158247
 * Note: If the file system is mounted RW, it will always be reported as not
Packit Service 158247
 *       clean!
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_xfs_check (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_repair:
Packit Service 158247
 * @device: the device containing the file system to repair
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the repair (right now
Packit Service 158247
 *                                                 passed to the 'xfs_repair' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an xfs file system on the @device was successfully repaired
Packit Service 158247
 *          (if needed) or not (error is set in that case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_xfs_repair (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_set_label:
Packit Service 158247
 * @device: the device containing the file system to set label for
Packit Service 158247
 * @label: label to set
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the label of xfs file system on the @device was
Packit Service 158247
 *          successfully set or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_xfs_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_get_info:
Packit Service 158247
 * @device: the device containing the file system to get info for (device must
Packit Service 158247
            be mounted, trying to get info for an unmounted device will result
Packit Service 158247
            in an error)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): information about the file system on @device or
Packit Service 158247
 *                           %NULL in case of error
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
BDFSXfsInfo* bd_fs_xfs_get_info (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_xfs_resize:
Packit Service 158247
 * @mpoint: the mount point of the file system to resize
Packit Service 158247
 * @new_size: new requested size for the file system *in file system blocks* (see bd_fs_xfs_get_info())
Packit Service 158247
 *            (if 0, the file system is adapted to the underlying block device)
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the resize (right now
Packit Service 158247
 *                                                 passed to the 'xfs_growfs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system mounted on @mpoint was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_XFS-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_xfs_resize (const gchar *mpoint, guint64 new_size, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_mkfs:
Packit Service 158247
 * @device: the device to create a new vfat fs on
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
Packit Service 158247
 *                                                 passed to the 'mkfs.vfat' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether a new vfat fs was successfully created on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_MKFS
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_vfat_mkfs (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_wipe:
Packit Service 158247
 * @device: the device to wipe an vfat signature from
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an vfat signature was successfully wiped from the @device or
Packit Service 158247
 *          not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_vfat_wipe (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_check:
Packit Service 158247
 * @device: the device containing the file system to check
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the repair (right now
Packit Service 158247
 *                                                 passed to the 'fsck.vfat' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an vfat file system on the @device is clean or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_vfat_check (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_repair:
Packit Service 158247
 * @device: the device containing the file system to repair
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the repair (right now
Packit Service 158247
 *                                                 passed to the 'fsck.vfat' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an vfat file system on the @device was successfully repaired
Packit Service 158247
 *          (if needed) or not (error is set in that case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_vfat_repair (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_set_label:
Packit Service 158247
 * @device: the device containing the file system to set label for
Packit Service 158247
 * @label: label to set
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the label of vfat file system on the @device was
Packit Service 158247
 *          successfully set or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_vfat_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_get_info:
Packit Service 158247
 * @device: the device containing the file system to get info for
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): information about the file system on @device or
Packit Service 158247
 *                           %NULL in case of error
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
BDFSVfatInfo* bd_fs_vfat_get_info (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_vfat_resize:
Packit Service 158247
 * @device: the device the file system of which to resize
Packit Service 158247
 * @new_size: new requested size for the file system (if 0, the file system is
Packit Service 158247
 *            adapted to the underlying block device)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_VFAT-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_vfat_resize (const gchar *device, guint64 new_size, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_mkfs:
Packit Service 158247
 * @device: the device to create a new ntfs fs on
Packit Service 158247
 * @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
Packit Service 158247
 *                                                 passed to the 'mkntfs' utility)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether a new NTFS fs was successfully created on @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_MKFS
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ntfs_mkfs (const gchar *device, const BDExtraArg **extra, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_wipe:
Packit Service 158247
 * @device: the device to wipe an ntfs signature from
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ntfs signature was successfully wiped from the @device or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_WIPE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ntfs_wipe (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_check:
Packit Service 158247
 * @device: the device containing the file system to check
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an ntfs file system on the @device is clean or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_CHECK
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ntfs_check (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_repair:
Packit Service 158247
 * @device: the device containing the file system to repair
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether an NTFS file system on the @device was successfully repaired
Packit Service 158247
 *          (if needed) or not (error is set in that case)
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_REPAIR
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ntfs_repair (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_set_label:
Packit Service 158247
 * @device: the device containing the file system to set the label for
Packit Service 158247
 * @label: label to set
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the label of the NTFS file system on the @device was
Packit Service 158247
 *          successfully set or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_SET_LABEL
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ntfs_set_label (const gchar *device, const gchar *label, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_resize:
Packit Service 158247
 * @device: the device the file system of which to resize
Packit Service 158247
 * @new_size: new requested size for the file system in bytes (if 0, the file system
Packit Service 158247
 *            is adapted to the underlying block device)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: whether the file system on @device was successfully resized or not
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_RESIZE
Packit Service 158247
 */
Packit Service 158247
gboolean  bd_fs_ntfs_resize (const gchar *device, guint64 new_size, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
/**
Packit Service 158247
 * bd_fs_ntfs_get_info:
Packit Service 158247
 * @device: the device containing the file system to get info for (device must
Packit Service 158247
            not be mounted, trying to get info for a mounted device will result
Packit Service 158247
            in an error)
Packit Service 158247
 * @error: (out): place to store error (if any)
Packit Service 158247
 *
Packit Service 158247
 * Returns: (transfer full): information about the file system on @device or
Packit Service 158247
 *                           %NULL in case of error
Packit Service 158247
 *
Packit Service 158247
 * Tech category: %BD_FS_TECH_NTFS-%BD_FS_TECH_MODE_QUERY
Packit Service 158247
 */
Packit Service 158247
BDFSNtfsInfo* bd_fs_ntfs_get_info (const gchar *device, GError **error);
Packit Service 158247
Packit Service 158247
Packit Service 158247
#endif  /* BD_FS_API */