mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-24 18:43:53 +08:00
Add support for ocfs2 detection to the blkid library,
courtesy of manish.singh@oracle.com
This commit is contained in:
parent
9ee42c9509
commit
414846b126
@ -1,5 +1,8 @@
|
||||
2004-09-17 Theodore Ts'o <tytso@mit.edu>
|
||||
|
||||
* probe.c, probe.h: Add support for ocfs2 detection, courtesy of
|
||||
manish.singh@oracle.com
|
||||
|
||||
* getsize.c: Clean up header #include's. Include sys/disk.h if
|
||||
present since this is the new place where the
|
||||
DIOCGMEDIASIZE ioctl is defined on FreeBSD systems.
|
||||
|
@ -327,9 +327,7 @@ static int probe_ocfs(int fd __BLKID_ATTR((unused)),
|
||||
|
||||
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 @@ static int probe_ocfs(int fd __BLKID_ATTR((unused)),
|
||||
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 @@ static struct blkid_magic type_array[] = {
|
||||
{ "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 }
|
||||
};
|
||||
|
||||
|
@ -234,6 +234,21 @@ struct ocfs_volume_label {
|
||||
|
||||
#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 */
|
||||
|
Loading…
Reference in New Issue
Block a user