Add support to the blkid library to recognize Oracle ASM volumes.
diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog
index ec1b98f..28e9724 100644
--- a/lib/blkid/ChangeLog
+++ b/lib/blkid/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-21 Theodore Ts'o <tytso@mit.edu>
+
+ * probe.c (probe_oracleasm): Add support for recognizing Oracle
+ ASM volumes. Thanks to Manish Singh (manish.singh at
+ oracle.com) for supplying this patch.
+
2005-01-18 Theodore Ts'o <tytso@mit.edu>
* Makefile.in: Fix the kernel compile-time echo commands to be
diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c
index d91e2a3..d203c88 100644
--- a/lib/blkid/probe.c
+++ b/lib/blkid/probe.c
@@ -422,10 +422,10 @@
}
static int probe_ocfs2(int fd __BLKID_ATTR((unused)),
- blkid_cache cache __BLKID_ATTR((unused)),
- blkid_dev dev,
- struct blkid_magic *id __BLKID_ATTR((unused)),
- unsigned char *buf)
+ blkid_cache cache __BLKID_ATTR((unused)),
+ blkid_dev dev,
+ struct blkid_magic *id __BLKID_ATTR((unused)),
+ unsigned char *buf)
{
struct ocfs2_super_block *osb;
@@ -436,6 +436,20 @@
return 0;
}
+static int probe_oracleasm(int fd __BLKID_ATTR((unused)),
+ blkid_cache cache __BLKID_ATTR((unused)),
+ blkid_dev dev,
+ struct blkid_magic *id __BLKID_ATTR((unused)),
+ unsigned char *buf)
+{
+ struct oracle_asm_disk_label *dl;
+
+ dl = (struct oracle_asm_disk_label *)buf;
+
+ blkid_set_tag(dev, "LABEL", dl->dl_id, sizeof(dl->dl_id));
+ return 0;
+}
+
/*
* BLKID_BLK_OFFS is at least as large as the highest bim_kboff defined
* in the type_array table below + bim_kbalign.
@@ -452,6 +466,7 @@
*/
static struct blkid_magic type_array[] = {
/* type kboff sboff len magic probe */
+ { "oracleasm", 0, 32, 8, "ORCLDISK", probe_oracleasm },
{ "jbd", 1, 0x38, 2, "\123\357", probe_jbd },
{ "ext3", 1, 0x38, 2, "\123\357", probe_ext3 },
{ "ext2", 1, 0x38, 2, "\123\357", probe_ext2 },
@@ -500,11 +515,11 @@
{ "swap", 0, 0x7ff6, 10, "SWAPSPACE2", probe_swap1 },
{ "swap", 0, 0xfff6, 10, "SWAP-SPACE", probe_swap0 },
{ "swap", 0, 0xfff6, 10, "SWAPSPACE2", probe_swap1 },
- { "ocfs", 0, 8, 9, "OracleCFS", probe_ocfs },
- { "ocfs2", 1, 0, 6, "OCFSV2", probe_ocfs2 },
- { "ocfs2", 2, 0, 6, "OCFSV2", probe_ocfs2 },
- { "ocfs2", 4, 0, 6, "OCFSV2", probe_ocfs2 },
- { "ocfs2", 8, 0, 6, "OCFSV2", probe_ocfs2 },
+ { "ocfs", 0, 8, 9, "OracleCFS", probe_ocfs },
+ { "ocfs2", 1, 0, 6, "OCFSV2", probe_ocfs2 },
+ { "ocfs2", 2, 0, 6, "OCFSV2", probe_ocfs2 },
+ { "ocfs2", 4, 0, 6, "OCFSV2", probe_ocfs2 },
+ { "ocfs2", 8, 0, 6, "OCFSV2", probe_ocfs2 },
{ NULL, 0, 0, 0, NULL, NULL }
};
diff --git a/lib/blkid/probe.h b/lib/blkid/probe.h
index ee91abb..c1d923f 100644
--- a/lib/blkid/probe.h
+++ b/lib/blkid/probe.h
@@ -252,6 +252,15 @@
#define OCFS2_SUPER_BLOCK_SIGNATURE "OCFSV2"
+struct oracle_asm_disk_label {
+ char dummy[32];
+ char dl_tag[8];
+ char dl_id[24];
+};
+
+#define ORACLE_ASM_DISK_LABEL_MARKED "ORCLDISK"
+#define ORACLE_ASM_DISK_LABEL_OFFSET 32
+
#define ISODCL(from, to) (to - from + 1)
struct iso_volume_descriptor {
char type[ISODCL(1,1)]; /* 711 */