rpms/e2fsprogs/devel e2fsprogs-1.39-blkid-gfs.patch, NONE, 1.1 e2fsprogs.spec, 1.59, 1.60

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Jul 10 06:30:02 UTC 2006


Author: kzak

Update of /cvs/dist/rpms/e2fsprogs/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv30604

Modified Files:
	e2fsprogs.spec 
Added Files:
	e2fsprogs-1.39-blkid-gfs.patch 
Log Message:
add GFS/GFS2 support

e2fsprogs-1.39-blkid-gfs.patch:
 ChangeLog |    4 ++++
 probe.c   |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 probe.h   |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)

--- NEW FILE e2fsprogs-1.39-blkid-gfs.patch ---
--- e2fsprogs-1.39/lib/blkid/probe.c.gfs	2006-05-14 23:24:09.000000000 +0200
+++ e2fsprogs-1.39/lib/blkid/probe.c	2006-07-10 08:15:11.000000000 +0200
@@ -646,6 +646,50 @@
 	return 0;
 }
 
+static int probe_gfs(struct blkid_probe *probe,
+		     struct blkid_magic *id __BLKID_ATTR((unused)),
+		     unsigned char *buf)
+{
+	struct gfs2_sb *sbd;
+	const char *label = 0;
+
+	sbd = (struct gfs2_sb *)buf;
+
+	if (blkid_be32(sbd->sb_fs_format) == GFS_FORMAT_FS &&
+	    blkid_be32(sbd->sb_multihost_format) == GFS_FORMAT_MULTI)
+	{	
+		blkid_set_tag(probe->dev, "UUID", 0, 0);
+	
+		if (strlen(sbd->sb_locktable))
+			label = sbd->sb_locktable;
+		blkid_set_tag(probe->dev, "LABEL", label, sizeof(sbd->sb_locktable));
+		return 0;
+	}
+	return 1;
+}
+
+static int probe_gfs2(struct blkid_probe *probe,
+		     struct blkid_magic *id __BLKID_ATTR((unused)),
+		     unsigned char *buf)
+{
+	struct gfs2_sb *sbd;
+	const char *label = 0;
+
+	sbd = (struct gfs2_sb *)buf;
+
+	if (blkid_be32(sbd->sb_fs_format) == GFS2_FORMAT_FS &&
+	    blkid_be32(sbd->sb_multihost_format) == GFS2_FORMAT_MULTI)
+	{	
+		blkid_set_tag(probe->dev, "UUID", 0, 0);
+	
+		if (strlen(sbd->sb_locktable))
+			label = sbd->sb_locktable;
+		blkid_set_tag(probe->dev, "LABEL", label, sizeof(sbd->sb_locktable));
+		return 0;
+	}
+	return 1;
+}
+
 /*
  * BLKID_BLK_OFFS is at least as large as the highest bim_kboff defined
  * in the type_array table below + bim_kbalign.
@@ -673,6 +717,8 @@
   { "reiserfs", 64,   0x34,  8, "ReIsErFs",		probe_reiserfs },
   { "reiserfs",	 8,	20,  8, "ReIsErFs",		probe_reiserfs },
   { "reiser4",  64,	 0,  7, "ReIsEr4",		probe_reiserfs4 },
+  { "gfs2",     64,      0,  4, "\x01\x16\x19\x70",     probe_gfs2 },
+  { "gfs",      64,      0,  4, "\x01\x16\x19\x70",     probe_gfs },
   { "vfat",      0,   0x52,  5, "MSWIN",                probe_fat },
   { "vfat",      0,   0x52,  8, "FAT32   ",             probe_fat },
   { "vfat",      0,   0x36,  5, "MSDOS",                probe_fat },
--- e2fsprogs-1.39/lib/blkid/probe.h.gfs	2006-03-10 21:43:35.000000000 +0100
+++ e2fsprogs-1.39/lib/blkid/probe.h	2006-07-07 13:45:43.000000000 +0200
@@ -345,6 +345,54 @@
 	unsigned char	escape_sequences[8];
 };
 
+/* Common gfs/gfs2 constants: */
+#define GFS_MAGIC               0x01161970
+#define GFS_DEFAULT_BSIZE       4096
+#define GFS_SUPERBLOCK_OFFSET	(0x10 * GFS_DEFAULT_BSIZE)
+#define GFS_METATYPE_SB         1
+#define GFS_FORMAT_SB           100
+#define GFS_LOCKNAME_LEN        64
+
+/* gfs1 constants: */
+#define GFS_FORMAT_FS           1309
+#define GFS_FORMAT_MULTI        1401
+/* gfs2 constants: */
+#define GFS2_FORMAT_FS          1801
+#define GFS2_FORMAT_MULTI       1900
+
+struct gfs2_meta_header {
+	__u32 mh_magic;
+	__u32 mh_type;
+	__u64 __pad0;          /* Was generation number in gfs1 */
+	__u32 mh_format;
+	__u32 __pad1;          /* Was incarnation number in gfs1 */
+};
+
+struct gfs2_inum {
+	__u64 no_formal_ino;
+	__u64 no_addr;
+};
+
+struct gfs2_sb {
+	struct gfs2_meta_header sb_header;
+
+	__u32 sb_fs_format;
+	__u32 sb_multihost_format;
+	__u32  __pad0;  /* Was superblock flags in gfs1 */
+	
+	__u32 sb_bsize;
+	__u32 sb_bsize_shift;
+	__u32 __pad1;   /* Was journal segment size in gfs1 */
+	
+	struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */
+	struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */
+	struct gfs2_inum sb_root_dir;
+	
+	char sb_lockproto[GFS_LOCKNAME_LEN];
+	char sb_locktable[GFS_LOCKNAME_LEN];
+	/* In gfs1, quota and license dinodes followed */
+} PACKED;
+
 /*
  * Byte swap functions
  */
--- e2fsprogs-1.39/lib/blkid/ChangeLog.gfs	2006-05-14 23:25:12.000000000 +0200
+++ e2fsprogs-1.39/lib/blkid/ChangeLog	2006-07-10 08:16:22.000000000 +0200
@@ -0,0 +1,4 @@
+2006-07-10  Karel Zak  <kzak at redhat.com>
+
+	* probe.c (probe_gfs, _gfs2), probe.h: Add support for GFS/GFS2 
+


Index: e2fsprogs.spec
===================================================================
RCS file: /cvs/dist/rpms/e2fsprogs/devel/e2fsprogs.spec,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- e2fsprogs.spec	6 Jul 2006 20:54:40 -0000	1.59
+++ e2fsprogs.spec	10 Jul 2006 06:29:59 -0000	1.60
@@ -4,7 +4,7 @@
 Summary: Utilities for managing the second extended (ext2) filesystem.
 Name: e2fsprogs
 Version: 1.39
-Release: 1
+Release: 2
 License: GPL
 Group: System Environment/Base
 Source:  ftp://download.sourceforge.net/pub/sourceforge/e2fsprogs/e2fsprogs-%{version}.tar.gz
@@ -13,6 +13,7 @@
 Patch32: e2fsprogs-1.38-no_pottcdate.patch
 Patch34: e2fsprogs-1.39-blkid-devmapper.patch
 Patch36: e2fsprogs-1.38-etcblkid.patch
+Patch37: e2fsprogs-1.39-blkid-gfs.patch
 Url: http://e2fsprogs.sourceforge.net/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: e2fsprogs-libs = %{version}-%{release}, device-mapper
@@ -68,6 +69,8 @@
 %patch34 -p1 -b .dm
 # put blkid.tab in /etc/blkid/
 %patch36 -p1 -b .etcblkid
+# GFS/GFS2 detection
+%patch37 -p1 -b .gfs
 
 %build
 aclocal
@@ -219,6 +222,9 @@
 %{_mandir}/man3/uuid_unparse.3*
 
 %changelog
+* Mon Jul 10 2006 Karel Zak <kzak at redhat.com> - 1.39-2
+- add GFS abd GFS2 support to libblkid
+
 * Thu Jul  6 2006 Thomas Woerner <twoerner at redhat.com> - 1.39-1
 - new version 1.39
 - dropped ext2online, because resize2fs is now able to do online resize




More information about the fedora-cvs-commits mailing list