FS

FS — plugin for operations with file systems

Functions

Types and Values

Includes

#include <fs.h>

Description

A plugin for operations with file systems

Functions

bd_fs_error_quark ()

GQuark
bd_fs_error_quark (void);

[skip]


bd_fs_wipe ()

gboolean
bd_fs_wipe (gchar *device,
            gboolean all,
            GError **error);

Parameters

device

the device to wipe signatures from

 

all

whether to wipe all (TRUE) signatures or just the first (FALSE) one

 

error

place to store error (if any).

[out]

Returns

whether signagures were successfully wiped on device or not


bd_fs_ext4_check ()

gboolean
bd_fs_ext4_check (gchar *device,
                  GError **error);

Parameters

device

the device the file system on which to check

 

error

place to store error (if any).

[out]

Returns

whether an ext4 file system on the device is clean or not


bd_fs_ext4_get_info ()

BDFSExt4Info *
bd_fs_ext4_get_info (gchar *device,
                     GError **error);

Parameters

device

the device the file system of which to get info for

 

error

place to store error (if any).

[out]

Returns

information about the file system on device or NULL in case of error.

[transfer full]


bd_fs_ext4_info_copy ()

BDFSExt4Info *
bd_fs_ext4_info_copy (BDFSExt4Info *data);

Creates a new copy of data .

[skip]


bd_fs_ext4_info_free ()

void
bd_fs_ext4_info_free (BDFSExt4Info *data);

Frees data .

[skip]


bd_fs_ext4_mkfs ()

gboolean
bd_fs_ext4_mkfs (gchar *device,
                 GError **error);

Parameters

device

the device to create a new ext4 fs on

 

error

place to store error (if any).

[out]

Returns

whether a new ext4 fs was successfully created on device or not


bd_fs_ext4_repair ()

gboolean
bd_fs_ext4_repair (gchar *device,
                   gboolean unsafe,
                   GError **error);

Parameters

device

the device the file system on which to repair

 

unsafe

whether to do unsafe operations too

 

error

place to store error (if any).

[out]

Returns

whether an ext4 file system on the device was successfully repaired (if needed) or not (error is set in that case)


bd_fs_ext4_resize ()

gboolean
bd_fs_ext4_resize (gchar *device,
                   guint64 new_size,
                   GError **error);

Parameters

device

the device the file system of which to resize

 

new_size

new requested size for the file system (if 0, the file system is adapted to the underlying block device)

 

error

place to store error (if any).

[out]

Returns

whether the file system on device was successfully resized or not


bd_fs_ext4_set_label ()

gboolean
bd_fs_ext4_set_label (gchar *device,
                      gchar *label,
                      GError **error);

Parameters

device

the device the file system on which to set label for

 

label

label to set

 

error

place to store error (if any).

[out]

Returns

whether the label of ext4 file system on the device was successfully set or not


bd_fs_ext4_wipe ()

gboolean
bd_fs_ext4_wipe (gchar *device,
                 GError **error);

Parameters

device

the device to wipe an ext4 signature from

 

error

place to store error (if any).

[out]

Returns

whether an ext4 signature was successfully wiped from the device or not


bd_fs_xfs_check ()

gboolean
bd_fs_xfs_check (gchar *device,
                 GError **error);

Parameters

device

the device containing the file system to check

 

error

place to store error (if any).

[out]

Returns

whether an xfs file system on the device is clean or not

Note: if the file system is mounted it may be reported as unclean even if everything is okay and there are just some pending/in-progress writes


bd_fs_xfs_get_info ()

BDFSXfsInfo *
bd_fs_xfs_get_info (gchar *device,
                    GError **error);

Parameters

device

the device containing the file system to get info for

 

error

place to store error (if any).

[out]

Returns

information about the file system on device or NULL in case of error.

[transfer full]


bd_fs_xfs_info_copy ()

BDFSXfsInfo *
bd_fs_xfs_info_copy (BDFSXfsInfo *data);

Creates a new copy of data .

[skip]


bd_fs_xfs_info_free ()

void
bd_fs_xfs_info_free (BDFSXfsInfo *data);

Frees data .

[skip]


bd_fs_xfs_info_get_type ()

GType
bd_fs_xfs_info_get_type ();

bd_fs_xfs_mkfs ()

gboolean
bd_fs_xfs_mkfs (gchar *device,
                GError **error);

Parameters

device

the device to create a new xfs fs on

 

error

place to store error (if any).

[out]

Returns

whether a new xfs fs was successfully created on device or not


bd_fs_xfs_repair ()

gboolean
bd_fs_xfs_repair (gchar *device,
                  GError **error);

Parameters

device

the device containing the file system to repair

 

error

place to store error (if any).

[out]

Returns

whether an xfs file system on the device was successfully repaired (if needed) or not (error is set in that case)


bd_fs_xfs_resize ()

gboolean
bd_fs_xfs_resize (gchar *mpoint,
                  guint64 new_size,
                  GError **error);

Parameters

mpoint

the mount point of the file system to resize

 

new_size

new requested size for the file system *in file system blocks* (see bd_fs_xfs_get_info()) (if 0, the file system is adapted to the underlying block device)

 

error

place to store error (if any).

[out]

Returns

whether the file system mounted on mpoint was successfully resized or not


bd_fs_xfs_set_label ()

gboolean
bd_fs_xfs_set_label (gchar *device,
                     gchar *label,
                     GError **error);

Parameters

device

the device containing the file system to set label for

 

label

label to set

 

error

place to store error (if any).

[out]

Returns

whether the label of xfs file system on the device was successfully set or not


bd_fs_xfs_wipe ()

gboolean
bd_fs_xfs_wipe (gchar *device,
                GError **error);

Parameters

device

the device to wipe an xfs signature from

 

error

place to store error (if any).

[out]

Returns

whether an xfs signature was successfully wiped from the device or not

Types and Values

BDFSExt4Info

typedef struct {
    gchar *label;
    gchar *uuid;
    gchar *state;
    guint64 block_size;
    guint64 block_count;
    guint64 free_blocks;
} BDFSExt4Info;

enum BDFsError

Members

BD_FS_ERROR_INVAL

   

BD_FS_ERROR_PARSE

   

BD_FS_ERROR_FAIL

   

BDFSXfsInfo

typedef struct {
    gchar *label;
    gchar *uuid;
    guint64 block_size;
    guint64 block_count;
} BDFSXfsInfo;