[Ocfs2-tools-commits] manish commits r237 - trunk/patches

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Sep 15 19:13:45 CDT 2004


Author: manish
Date: 2004-09-15 19:13:43 -0500 (Wed, 15 Sep 2004)
New Revision: 237

Added:
   trunk/patches/libblkidocfs2support.patch
Modified:
   trunk/patches/Makefile
Log:
Add libblkid support


Modified: trunk/patches/Makefile
===================================================================
--- trunk/patches/Makefile	2004-09-15 23:05:10 UTC (rev 236)
+++ trunk/patches/Makefile	2004-09-16 00:13:43 UTC (rev 237)
@@ -2,6 +2,6 @@
 
 include $(TOPDIR)/Preamble.make
 
-DIST_FILES = README mountocfs2support.patch
+DIST_FILES = README mountocfs2support.patch libblkidocfs2support.patch
 
 include $(TOPDIR)/Postamble.make

Added: trunk/patches/libblkidocfs2support.patch
===================================================================
--- trunk/patches/libblkidocfs2support.patch	2004-09-15 23:05:10 UTC (rev 236)
+++ trunk/patches/libblkidocfs2support.patch	2004-09-16 00:13:43 UTC (rev 237)
@@ -0,0 +1,72 @@
+--- 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 }
+ };
+ 



More information about the Ocfs2-tools-commits mailing list