--- probe.h.ocfs2 2004-09-15 17:11:55.000000000 -0700 +++ probe.h 2004-09-15 17:12:53.000000000 -0700 @@ -234,6 +234,21 @@ #define OCFS_MAGIC "OracleCFS" +struct ocfs2_super_block { + u_char signature[8]; + u_char s_dummy1[184]; + u_char s_dummy2[80]; + u_char s_label[64]; + u_char s_uuid[16]; +}; + +#define OCFS2_MIN_BLOCKSIZE 512 +#define OCFS2_MAX_BLOCKSIZE 4096 + +#define OCFS2_SUPER_BLOCK_BLKNO 2 + +#define OCFS2_SUPER_BLOCK_SIGNATURE "OCFSV2" + #define ISODCL(from, to) (to - from + 1) struct iso_volume_descriptor { char type[ISODCL(1,1)]; /* 711 */ --- probe.c.ocfs2 2004-09-15 17:11:55.000000000 -0700 +++ probe.c 2004-09-15 17:12:53.000000000 -0700 @@ -327,9 +327,7 @@ major = ocfsmajor(ovh); if (major == 1) - blkid_set_tag(dev,"SEC_TYPE","ocfs1",sizeof("ocfs1")); - else if (major == 2) - blkid_set_tag(dev,"SEC_TYPE","ocfs2",sizeof("ocfs2")); + blkid_set_tag(dev,"SEC_TYPE","ocfs1",sizeof("ocfs")); else if (major >= 9) blkid_set_tag(dev,"SEC_TYPE","ntocfs",sizeof("ntocfs")); @@ -339,6 +337,21 @@ return 0; } +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) +{ + struct ocfs2_super_block *osb; + + osb = (struct ocfs2_super_block *)buf; + + blkid_set_tag(dev, "LABEL", osb->s_label, sizeof(osb->s_label)); + set_uuid(dev, osb->s_uuid); + return 0; +} + /* * BLKID_BLK_OFFS is at least as large as the highest bim_kboff defined * in the type_array table below + bim_kbalign. @@ -398,7 +411,11 @@ { "swap", 0, 0x1ff6, 10, "SWAPSPACE2", 0 }, { "swap", 0, 0x3ff6, 10, "SWAP-SPACE", 0 }, { "swap", 0, 0x3ff6, 10, "SWAPSPACE2", 0 }, - { "ocfs", 0, 8, 9, "OracleCFS", probe_ocfs }, + { "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 } };