libblkid/src/superblocks/highpoint_raid.c \
libblkid/src/superblocks/hpfs.c \
libblkid/src/superblocks/iso9660.c \
+ libblkid/src/superblocks/iso9660.h \
libblkid/src/superblocks/isw_raid.c \
libblkid/src/superblocks/jfs.c \
libblkid/src/superblocks/jmicron_raid.c \
}
/* iso9660 [+ Microsoft Joliet Extension] */
-static int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag)
+int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag)
{
struct iso_volume_descriptor *iso;
unsigned char label[32];
--- /dev/null
+/*
+ * Copyright (C) 2013 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
+ *
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
+ */
+#ifndef _BLKID_ISO9660_H
+#define _BLKID_ISO9660_H
+
+#include "blkidP.h"
+
+extern int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag);
+
+#endif /* _BLKID_ISO9660_H */
#include <stdint.h>
#include "superblocks.h"
+#include "iso9660.h"
struct volume_descriptor {
struct descriptor_tag {
count = le32_to_cpu(vd->type.anchor.length) / bs;
loc = le32_to_cpu(vd->type.anchor.location);
- /* pick the primary descriptor from the list */
+ /* check if the list is usable */
for (b = 0; b < count; b++) {
vd = (struct volume_descriptor *)
blkid_probe_get_buffer(pr,
sizeof(*vd));
if (!vd)
return -1;
+ }
+
+ /* Try extract all possible ISO9660 information -- if there is
+ * usable LABEL in ISO header then use it, otherwise read UDF
+ * specific LABEL */
+ if (probe_iso9660(pr, mag) == 0 &&
+ __blkid_probe_lookup_value(pr, "LABEL") != NULL)
+ return 0;
+
+ /* Read UDF label */
+ for (b = 0; b < count; b++) {
+ vd = (struct volume_descriptor *)
+ blkid_probe_get_buffer(pr,
+ (blkid_loff_t) (loc + b) * bs,
+ sizeof(*vd));
type = le16_to_cpu(vd->tag.id);
if (type == 0)