Add option to probe only superblocks in blkid.

This commit is contained in:
Ondrej Kozina
2022-04-13 12:30:49 +02:00
committed by Milan Broz
parent be5c5788d4
commit 2388777763
2 changed files with 11 additions and 3 deletions

View File

@@ -73,14 +73,20 @@ void blk_set_chains_for_full_print(struct blkid_handle *h)
blk_set_chains_for_wipes(h);
}
void blk_set_chains_for_superblocks(struct blkid_handle *h)
{
#ifdef HAVE_BLKID
blkid_probe_enable_superblocks(h->pr, 1);
blkid_probe_set_superblocks_flags(h->pr, BLKID_SUBLKS_TYPE);
#endif
}
void blk_set_chains_for_fast_detection(struct blkid_handle *h)
{
#ifdef HAVE_BLKID
blkid_probe_enable_partitions(h->pr, 1);
blkid_probe_set_partitions_flags(h->pr, 0);
blkid_probe_enable_superblocks(h->pr, 1);
blkid_probe_set_superblocks_flags(h->pr, BLKID_SUBLKS_TYPE);
blk_set_chains_for_superblocks(h);
#endif
}