summaryrefslogtreecommitdiffstats
path: root/libblkid
diff options
context:
space:
mode:
authorPali Rohár2017-08-20 14:50:02 +0200
committerPali Rohár2017-08-20 14:50:02 +0200
commitc748335382a110376a0207c6457b15fc7a6e0b0c (patch)
treeb32c031a6dd258a46aaf748bd7ee37386ca1a658 /libblkid
parentlslogins: be more explicit with -g in man page (diff)
downloadkernel-qcow2-util-linux-c748335382a110376a0207c6457b15fc7a6e0b0c.tar.gz
kernel-qcow2-util-linux-c748335382a110376a0207c6457b15fc7a6e0b0c.tar.xz
kernel-qcow2-util-linux-c748335382a110376a0207c6457b15fc7a6e0b0c.zip
libblkid: udf: Define magic constants
Diffstat (limited to 'libblkid')
-rw-r--r--libblkid/src/superblocks/udf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libblkid/src/superblocks/udf.c b/libblkid/src/superblocks/udf.c
index 836008a8e..0c4bca12a 100644
--- a/libblkid/src/superblocks/udf.c
+++ b/libblkid/src/superblocks/udf.c
@@ -81,6 +81,11 @@ struct volume_descriptor {
} __attribute__((packed));
+#define TAG_ID_PVD 1
+#define TAG_ID_AVDP 2
+#define TAG_ID_LVD 6
+#define TAG_ID_LVID 9
+
struct volume_structure_descriptor {
uint8_t type;
uint8_t id[5];
@@ -223,7 +228,7 @@ anchor:
return errno ? -errno : 1;
type = le16_to_cpu(vd->tag.id);
- if (type == 2) /* TAG_ID_AVDP */
+ if (type == TAG_ID_AVDP)
goto real_blksz;
}
return 0;
@@ -249,7 +254,7 @@ real_blksz:
break;
if (le32_to_cpu(vd->tag.location) != loc + b)
break;
- if (type == 1) { /* TAG_ID_PVD */
+ if (type == TAG_ID_PVD) {
if (!have_volid) {
int enc = udf_cid_to_enc(vd->type.primary.ident.cid);
uint8_t clen = vd->type.primary.ident.clen;
@@ -306,7 +311,7 @@ real_blksz:
have_volsetid = !blkid_probe_set_utf8_id_label(pr, "VOLUME_SET_ID",
vd->type.primary.volset_id.c, clen, enc);
}
- } else if (type == 6) { /* TAG_ID_LVD */
+ } else if (type == TAG_ID_LVD) {
if (!num_partition_maps || !lvid_count || !lvid_loc) {
num_partition_maps = le32_to_cpu(vd->type.logical.num_partition_maps);
lvid_count = le32_to_cpu(vd->type.logical.lvid_length) / bs;
@@ -373,7 +378,7 @@ real_blksz:
break;
if (le32_to_cpu(vd->tag.location) != lvid_loc + b)
break;
- if (type == 9) { /* TAG_ID_LVID */
+ if (type == TAG_ID_LVID) {
uint16_t udf_rev;
lvidiu = (struct logical_vol_integ_descriptor_imp_use *)
blkid_probe_get_buffer(pr,