diff options
author | Karel Zak | 2011-05-13 12:28:12 +0200 |
---|---|---|
committer | Karel Zak | 2011-05-16 20:22:52 +0200 |
commit | a9eef56c4a768797c333385bdc8c6f97ff21f5ba (patch) | |
tree | 8e3301323ae78c7f1df6e39531b1a5335754b26a /shlibs/blkid | |
parent | mount: remove note about obsolete volume_id library from man page (diff) | |
download | kernel-qcow2-util-linux-a9eef56c4a768797c333385bdc8c6f97ff21f5ba.tar.gz kernel-qcow2-util-linux-a9eef56c4a768797c333385bdc8c6f97ff21f5ba.tar.xz kernel-qcow2-util-linux-a9eef56c4a768797c333385bdc8c6f97ff21f5ba.zip |
libblkid: cleanup flags
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid')
-rw-r--r-- | shlibs/blkid/src/blkidP.h | 13 | ||||
-rw-r--r-- | shlibs/blkid/src/partitions/partitions.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probe.c | 24 | ||||
-rw-r--r-- | shlibs/blkid/src/superblocks/superblocks.c | 2 |
4 files changed, 21 insertions, 20 deletions
diff --git a/shlibs/blkid/src/blkidP.h b/shlibs/blkid/src/blkidP.h index 540263711..53e4c5954 100644 --- a/shlibs/blkid/src/blkidP.h +++ b/shlibs/blkid/src/blkidP.h @@ -211,12 +211,13 @@ struct blkid_struct_probe int nvals; /* number of assigned vals */ }; -/* private flags */ -#define BLKID_PRIVATE_FD (1 << 1) /* see blkid_new_probe_from_filename() */ -#define BLKID_TINY_DEV (1 << 2) /* <= 1.47MiB (floppy or so) */ -#define BLKID_CDROM_DEV (1 << 3) /* is a CD/DVD drive */ -/* private probing flags */ -#define BLKID_PARTS_IGNORE_PT (1 << 1) /* ignore partition table */ +/* private flags library flags */ +#define BLKID_FL_PRIVATE_FD (1 << 1) /* see blkid_new_probe_from_filename() */ +#define BLKID_FL_TINY_DEV (1 << 2) /* <= 1.47MiB (floppy or so) */ +#define BLKID_FL_CDROM_DEV (1 << 3) /* is a CD/DVD drive */ + +/* private per-probing flags */ +#define BLKID_PROBE_FL_IGNORE_PT (1 << 1) /* ignore partition table */ /* * Evaluation methods (for blkid_eval_* API) diff --git a/shlibs/blkid/src/partitions/partitions.c b/shlibs/blkid/src/partitions/partitions.c index 759d08377..b4aca29bf 100644 --- a/shlibs/blkid/src/partitions/partitions.c +++ b/shlibs/blkid/src/partitions/partitions.c @@ -560,7 +560,7 @@ static int partitions_probe(blkid_probe pr, struct blkid_chain *chn) if (chn->binary) partitions_init_data(pr, chn); - if (!pr->wipe_size && (pr->prob_flags & BLKID_PARTS_IGNORE_PT)) + if (!pr->wipe_size && (pr->prob_flags & BLKID_PROBE_FL_IGNORE_PT)) goto details_only; DBG(DEBUG_LOWPROBE, diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c index 8b8982509..54af59333 100644 --- a/shlibs/blkid/src/probe.c +++ b/shlibs/blkid/src/probe.c @@ -184,7 +184,7 @@ blkid_probe blkid_new_probe_from_filename(const char *filename) if (blkid_probe_set_device(pr, fd, 0, 0)) goto err; - pr->flags |= BLKID_PRIVATE_FD; + pr->flags |= BLKID_FL_PRIVATE_FD; return pr; err: if (fd >= 0) @@ -215,7 +215,7 @@ void blkid_free_probe(blkid_probe pr) free(ch->fltr); } - if ((pr->flags & BLKID_PRIVATE_FD) && pr->fd >= 0) + if ((pr->flags & BLKID_FL_PRIVATE_FD) && pr->fd >= 0) close(pr->fd); blkid_probe_reset_buffer(pr); free(pr); @@ -563,7 +563,7 @@ static void blkid_probe_reset_buffer(blkid_probe pr) */ int blkid_probe_is_tiny(blkid_probe pr) { - return pr && (pr->flags & BLKID_TINY_DEV); + return pr && (pr->flags & BLKID_FL_TINY_DEV); } /* @@ -571,7 +571,7 @@ int blkid_probe_is_tiny(blkid_probe pr) */ int blkid_probe_is_cdrom(blkid_probe pr) { - return pr && (pr->flags & BLKID_CDROM_DEV); + return pr && (pr->flags & BLKID_FL_CDROM_DEV); } /** @@ -596,12 +596,12 @@ int blkid_probe_set_device(blkid_probe pr, int fd, blkid_reset_probe(pr); - if ((pr->flags & BLKID_PRIVATE_FD) && pr->fd >= 0) + if ((pr->flags & BLKID_FL_PRIVATE_FD) && pr->fd >= 0) close(pr->fd); - pr->flags &= ~BLKID_PRIVATE_FD; - pr->flags &= ~BLKID_TINY_DEV; - pr->flags &= ~BLKID_CDROM_DEV; + pr->flags &= ~BLKID_FL_PRIVATE_FD; + pr->flags &= ~BLKID_FL_TINY_DEV; + pr->flags &= ~BLKID_FL_CDROM_DEV; pr->fd = fd; pr->off = off; pr->size = 0; @@ -646,11 +646,11 @@ int blkid_probe_set_device(blkid_probe pr, int fd, } if (pr->size <= 1440 * 1024 && !S_ISCHR(sb.st_mode)) - pr->flags |= BLKID_TINY_DEV; + pr->flags |= BLKID_FL_TINY_DEV; #ifdef CDROM_GET_CAPABILITY if (S_ISBLK(sb.st_mode) && ioctl(fd, CDROM_GET_CAPABILITY, NULL) >= 0) - pr->flags |= BLKID_CDROM_DEV; + pr->flags |= BLKID_FL_CDROM_DEV; #endif DBG(DEBUG_LOWPROBE, printf("ready for low-probing, offset=%jd, size=%jd\n", @@ -694,10 +694,10 @@ int blkid_probe_set_dimension(blkid_probe pr, pr->off = off; pr->size = size; - pr->flags &= ~BLKID_TINY_DEV; + pr->flags &= ~BLKID_FL_TINY_DEV; if (pr->size <= 1440 * 1024 && !S_ISCHR(pr->mode)) - pr->flags |= BLKID_TINY_DEV; + pr->flags |= BLKID_FL_TINY_DEV; blkid_probe_reset_buffer(pr); diff --git a/shlibs/blkid/src/superblocks/superblocks.c b/shlibs/blkid/src/superblocks/superblocks.c index a1e1d3607..56a454332 100644 --- a/shlibs/blkid/src/superblocks/superblocks.c +++ b/shlibs/blkid/src/superblocks/superblocks.c @@ -450,7 +450,7 @@ static int superblocks_safeprobe(blkid_probe pr, struct blkid_chain *chn) * have to ignore such partition tables. */ if (chn->idx >= 0 && idinfos[chn->idx]->usage & BLKID_USAGE_RAID) - pr->prob_flags |= BLKID_PARTS_IGNORE_PT; + pr->prob_flags |= BLKID_PROBE_FL_IGNORE_PT; return 0; } |