Superblocks probing

Superblocks probing — filesystems and raids superblocks probing.

Synopsis

int                 blkid_probe_enable_superblocks      (blkid_probe pr,
                                                         int enable);

int                 blkid_known_fstype                  (const char *fstype);
int                 blkid_superblocks_get_name          (size_t idx,
                                                         const char **name,
                                                         int *usage);

int                 blkid_probe_filter_superblocks_type (blkid_probe pr,
                                                         int flag,
                                                         char *names[]);
int                 blkid_probe_filter_superblocks_usage
                                                        (blkid_probe pr,
                                                         int flag,
                                                         int usage);
int                 blkid_probe_invert_superblocks_filter
                                                        (blkid_probe pr);
int                 blkid_probe_reset_superblocks_filter
                                                        (blkid_probe pr);
int                 blkid_probe_set_superblocks_flags   (blkid_probe pr,
                                                         int flags);

int                 blkid_probe_reset_filter            (blkid_probe pr);
int                 blkid_probe_filter_types            (blkid_probe pr,
                                                         int flag,
                                                         char *names[]);
int                 blkid_probe_filter_usage            (blkid_probe pr,
                                                         int flag,
                                                         int usage);
int                 blkid_probe_invert_filter           (blkid_probe pr);
int                 blkid_probe_set_request             (blkid_probe pr,
                                                         int flags);

Description

The library API has been originaly designed for superblocks probing only. This is reason why some *deprecated* superblock specific functions don't use '_superblocks_' namespace in the function name. Please, don't use these functions in new code.

The 'superblocks' probers support NAME=value (tags) interface only. The superblocks probing is enabled by default (and controled by blkid_probe_enable_superblocks()).

Currently supported tags:

TYPE: filesystem type

SEC_TYPE: secondary filesystem type

LABEL: filesystem label

LABEL_RAW: raw label from FS superblock

UUID: filesystem UUID (lower case)

UUID_SUB: subvolume uuid (e.g. btrfs)

UUID_RAW: raw UUID from FS superblock

EXT_JOURNAL: external journal UUID

USAGE: usage string: "raid", "filesystem", ...

VERSION: filesystem version

MOUNT: cluster mount name (?) -- ocfs only

SBMAGIC: super block magic string

SBMAGIC_OFFSET: offset of SBMAGIC

FSSIZE: size of filessystem [not-implemented yet]

Details

blkid_probe_enable_superblocks ()

int                 blkid_probe_enable_superblocks      (blkid_probe pr,
                                                         int enable);

Enables/disables the superblocks probing for non-binary interface.

pr :

probe

enable :

TRUE/FALSE

Returns :

0 on success, or -1 in case of error.

blkid_known_fstype ()

int                 blkid_known_fstype                  (const char *fstype);

fstype :

filesystem name

Returns :

1 for known filesytems, or 0 for unknown filesystem.

blkid_superblocks_get_name ()

int                 blkid_superblocks_get_name          (size_t idx,
                                                         const char **name,
                                                         int *usage);

idx :

number >= 0

name :

returns name of supported filesystem/raid (optional)

usage :

returns BLKID_USAGE_* flags, (optional)

Returns :

-1 if idx is out of range, or 0 on success.

blkid_probe_filter_superblocks_type ()

int                 blkid_probe_filter_superblocks_type (blkid_probe pr,
                                                         int flag,
                                                         char *names[]);

BLKID_FLTR_NOTIN - probe for all items which are NOT IN names;

BLKID_FLTR_ONLYIN - probe for items which are IN names

pr :

prober

flag :

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

names :

NULL terminated array of probing function names (e.g. "vfat").

Returns :

0 on success, or -1 in case of error.

blkid_probe_filter_superblocks_usage ()

int                 blkid_probe_filter_superblocks_usage
                                                        (blkid_probe pr,
                                                         int flag,
                                                         int usage);

BLKID_FLTR_NOTIN - probe for all items which are NOT IN usage;

BLKID_FLTR_ONLYIN - probe for items which are IN usage

pr :

prober

flag :

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

usage :

BLKID_USAGE_* flags

Returns :

0 on success, or -1 in case of error.

blkid_probe_invert_superblocks_filter ()

int                 blkid_probe_invert_superblocks_filter
                                                        (blkid_probe pr);

Inverts superblocks probing filter

pr :

prober

Returns :

0 on success, or -1 in case of error.

blkid_probe_reset_superblocks_filter ()

int                 blkid_probe_reset_superblocks_filter
                                                        (blkid_probe pr);

Resets superblocks probing filter

pr :

prober

Returns :

0 on success, or -1 in case of error.

blkid_probe_set_superblocks_flags ()

int                 blkid_probe_set_superblocks_flags   (blkid_probe pr,
                                                         int flags);

Sets probing flags to the superblocks prober. This function is optional, the default are BLKID_SUBLKS_DEFAULTS flags.

pr :

prober

flags :

BLKID_SUBLKS_* flags

Returns :

0 on success, or -1 in case of error.

blkid_probe_reset_filter ()

int                 blkid_probe_reset_filter            (blkid_probe pr);

Warning

blkid_probe_reset_filter is deprecated and should not be used in newly-written code. Use blkid_probe_reset_superblocks_filter().

pr :

prober

Returns :

0 on success, or -1 in case of error.

blkid_probe_filter_types ()

int                 blkid_probe_filter_types            (blkid_probe pr,
                                                         int flag,
                                                         char *names[]);

Warning

blkid_probe_filter_types is deprecated and should not be used in newly-written code. Use blkid_probe_filter_superblocks_types().

pr :

prober

flag :

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

names :

NULL terminated array of probing function names (e.g. "vfat").

Returns :

0 on success, or -1 in case of error.

blkid_probe_filter_usage ()

int                 blkid_probe_filter_usage            (blkid_probe pr,
                                                         int flag,
                                                         int usage);

Warning

blkid_probe_filter_usage is deprecated and should not be used in newly-written code. Use blkid_probe_filter_superblocks_usage().

pr :

prober

flag :

filter BLKID_FLTR_{NOTIN,ONLYIN} flag

usage :

BLKID_USAGE_* flags

Returns :

0 on success, or -1 in case of error.

blkid_probe_invert_filter ()

int                 blkid_probe_invert_filter           (blkid_probe pr);

Warning

blkid_probe_invert_filter is deprecated and should not be used in newly-written code. Use blkid_probe_invert_superblocks_filter().

pr :

prober

Returns :

0 on success, or -1 in case of error.

blkid_probe_set_request ()

int                 blkid_probe_set_request             (blkid_probe pr,
                                                         int flags);

Warning

blkid_probe_set_request is deprecated and should not be used in newly-written code. Use blkid_probe_set_superblocks_flags().

pr :

probe

flags :

BLKID_PROBREQ_* (deprecated) or BLKID_SUBLKS_* flags

Returns :

0 on success, or -1 in case of error.