return 1;
}
+static int probe_ocfs(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 ocfs_volume_header ovh;
+ struct ocfs_volume_label ovl;
+ uint major;
+
+ memcpy(&ovh, buf, sizeof(ovh));
+ memcpy(&ovl, buf+512, sizeof(ovl));
+
+ 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"));
+ else if (major >= 9)
+ blkid_set_tag(dev,"SEC_TYPE","ntocfs",sizeof("ntocfs"));
+
+ blkid_set_tag(dev, "LABEL", ovl.label, ocfslabellen(ovl));
+ blkid_set_tag(dev, "MOUNT", ovh.mount, ocfsmountlen(ovh));
+ set_uuid(dev, ovl.vol_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.
{ "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 },
{ NULL, 0, 0, 0, NULL, NULL }
};
__u32 h_blksize;
};
+struct ocfs_volume_header {
+ u_char minor_version[4];
+ u_char major_version[4];
+ u_char signature[128];
+ u_char mount[128];
+ u_char mount_len[2];
+};
+
+struct ocfs_volume_label {
+ u_char disk_lock[48];
+ u_char label[64];
+ u_char label_len[2];
+ u_char vol_id[16];
+ u_char vol_id_len[2];
+};
+
+#define ocfsmajor(o) ((uint)o.major_version[0] \
+ + (((uint) o.major_version[1]) << 8) \
+ + (((uint) o.major_version[2]) << 16) \
+ + (((uint) o.major_version[3]) << 24))
+#define ocfslabellen(o) ((uint)o.label_len[0] + (((uint) o.label_len[1]) << 8))
+#define ocfsmountlen(o) ((uint)o.mount_len[0] + (((uint) o.mount_len[1])<<8))
+
+#define OCFS_MAGIC "OracleCFS"
+
#define ISODCL(from, to) (to - from + 1)
struct iso_volume_descriptor {
char type[ISODCL(1,1)]; /* 711 */