Debian Codegraph @

src/plugins/fs/generic.h

raw
1 #include <glib.h>
2
3 #ifndef BD_FS_GENERIC
4 #define BD_FS_GENERIC
5
6 gboolean bd_fs_wipe (const gchar *device, gboolean all, gboolean force, GError **error) ;
7 gboolean bd_fs_clean (const gchar *device, gboolean force, GError **error);
8 gchar* bd_fs_get_fstype (const gchar *device, GError **error);
9
10 gboolean bd_fs_freeze (const gchar *mountpoint, GError **error);
11 gboolean bd_fs_unfreeze (const gchar *mountpoint, GError **error);
12
13 typedef enum {
14 BD_FS_MKFS_LABEL = 1 << 0,
15 BD_FS_MKFS_UUID = 1 << 1,
16 BD_FS_MKFS_DRY_RUN = 1 << 2,
17 BD_FS_MKFS_NODISCARD = 1 << 3,
18 BD_FS_MKFS_FORCE = 1 << 4,
19 BD_FS_MKFS_NOPT = 1 << 5,
20 } BDFSMkfsOptionsFlags;
21
22 typedef struct BDFSMkfsOptions {
23 const gchar *label;
24 const gchar *uuid;
25 gboolean dry_run;
26 gboolean no_discard;
27 gboolean force;
28 gboolean no_pt;
29 guint8 reserve[32];
30 } BDFSMkfsOptions;
31
32 BDFSMkfsOptions* bd_fs_mkfs_options_copy (BDFSMkfsOptions *data);
33 void bd_fs_mkfs_options_free (BDFSMkfsOptions *data);
34
35 const gchar** bd_fs_supported_filesystems (GError **error);
36
37 gboolean bd_fs_mkfs (const gchar *device, const gchar *fstype, BDFSMkfsOptions *options, const BDExtraArg **extra, GError **error);
38
39 gboolean bd_fs_resize (const gchar *device, guint64 new_size, const gchar *fstype, GError **error);
40 gboolean bd_fs_repair (const gchar *device, const gchar *fstype, GError **error);
41 gboolean bd_fs_check (const gchar *device, const gchar *fstype, GError **error);
42 gboolean bd_fs_set_label (const gchar *device, const gchar *label, const gchar *fstype, GError **error);
43 gboolean bd_fs_check_label (const gchar *fstype, const gchar *label, GError **error);
44 gboolean bd_fs_set_uuid (const gchar *device, const gchar *uuid, const gchar *fstype, GError **error);
45 gboolean bd_fs_check_uuid (const gchar *fstype, const gchar *uuid, GError **error);
46 guint64 bd_fs_get_size (const gchar *device, const gchar *fstype, GError **error);
47 guint64 bd_fs_get_free_space (const gchar *device, const gchar *fstype, GError **error);
48 guint64 bd_fs_get_min_size (const gchar *device, const gchar *fstype, GError **error);
49
50 typedef enum {
51 BD_FS_OFFLINE_SHRINK = 1 << 1,
52 BD_FS_OFFLINE_GROW = 1 << 2,
53 BD_FS_ONLINE_SHRINK = 1 << 3,
54 BD_FS_ONLINE_GROW = 1 << 4
55 } BDFSResizeFlags;
56
57 typedef enum {
58 BD_FS_SUPPORT_SET_LABEL = 1 << 1,
59 BD_FS_SUPPORT_SET_UUID = 1 << 2
60 } BDFSConfigureFlags;
61
62 typedef enum {
63 BD_FS_FSCK_CHECK = 1 << 1,
64 BD_FS_FSCK_REPAIR = 1 << 2
65 } BDFSFsckFlags;
66
67 typedef enum {
68 BD_FS_FEATURE_OWNERS = 1 << 1,
69 BD_FS_FEATURE_PARTITION_TABLE = 1 << 2,
70 } BDFSFeatureFlags;
71
72 typedef struct BDFSFeatures {
73 BDFSResizeFlags resize;
74 BDFSMkfsOptionsFlags mkfs;
75 BDFSFsckFlags fsck;
76 BDFSConfigureFlags configure;
77 BDFSFeatureFlags features;
78 const gchar *partition_id;
79 const gchar *partition_type;
80 guint64 min_size;
81 guint64 max_size;
82 } BDFSFeatures;
83
84 BDFSFeatures* bd_fs_features_copy (BDFSFeatures *data);
85 void bd_fs_features_free (BDFSFeatures *data);
86
87 const BDFSFeatures* bd_fs_features (const gchar *fstype, GError **error);
88
89 gboolean bd_fs_can_mkfs (const gchar *type, BDFSMkfsOptionsFlags *options, gchar **required_utility, GError **error);
90 gboolean bd_fs_can_resize (const gchar *type, BDFSResizeFlags *mode, gchar **required_utility, GError **error);
91 gboolean bd_fs_can_check (const gchar *type, gchar **required_utility, GError **error);
92 gboolean bd_fs_can_repair (const gchar *type, gchar **required_utility, GError **error);
93 gboolean bd_fs_can_set_label (const gchar *type, gchar **required_utility, GError **error);
94 gboolean bd_fs_can_set_uuid (const gchar *type, gchar **required_utility, GError **error);
95 gboolean bd_fs_can_get_size (const gchar *type, gchar **required_utility, GError **error);
96 gboolean bd_fs_can_get_free_space (const gchar *type, gchar **required_utility, GError **error);
97 gboolean bd_fs_can_get_info (const gchar *type, gchar **required_utility, GError **error);
98 gboolean bd_fs_can_get_min_size (const gchar *type, gchar **required_utility, GError **error);
99
100 #endif /* BD_FS_GENERIC */