Linux Hotplug development
 help / color / mirror / Atom feed
* libvolume_id: Support for GFS2 UUIDs
@ 2008-10-10 10:54 Steven Whitehouse
  2008-10-13  1:36 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Whitehouse @ 2008-10-10 10:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com


Here is a patch to add GFS2 UUID support to libvolume_id. Please
consider applying,

Steve.

diff --git a/extras/volume_id/README b/extras/volume_id/README
index 0c5e37f..44a9a87 100644
--- a/extras/volume_id/README
+++ b/extras/volume_id/README
@@ -40,7 +40,7 @@ minix                  *      -      -     *
 ocfs (1, 2)            *      *      *     *
 vxfs                   *      -      -     *
 nss (netware)          *             *     *
-gfs, gfs2              *      *      -     -
+gfs, gfs2              *      *      *     -
 oracleasm              *      *      -     -
 
 Raid members are detected to prevent the probing for a filesystem
diff --git a/extras/volume_id/lib/gfs.c b/extras/volume_id/lib/gfs.c
index 25f96f6..d97730c 100644
--- a/extras/volume_id/lib/gfs.c
+++ b/extras/volume_id/lib/gfs.c
@@ -76,9 +76,22 @@ struct gfs2_sb {
 
 	char sb_lockproto[GFS_LOCKNAME_LEN];
 	char sb_locktable[GFS_LOCKNAME_LEN];
-	/* In gfs1, quota and license dinodes followed */
+
+	struct gfs2_inum __pad3; /* Was quota inode in gfs1 */
+	struct gfs2_inum __pad4; /* Was licence inode in gfs1 */
+	uint8_t sb_uuid[16]; /* The UUID maybe 0 for backwards compat */
 } PACKED;
 
+static int uuid_non_zero(const uint8_t *p)
+{
+	int i;
+	for (i = 0; i < 16; i++) {
+		if (p[i] != 0)
+			return 1;
+	}
+	return 0;
+}
+
 static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int vers)
 {
 	struct gfs2_sb *sbd;
@@ -113,6 +126,8 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v
 			volume_id_set_label_raw(id, label, GFS_LOCKNAME_LEN);
 			volume_id_set_label_string(id, label, GFS_LOCKNAME_LEN);
 		}
+		if (vers = 2 && uuid_non_zero(sbd->sb_uuid))
+			volume_id_set_uuid(id, sbd->sb_uuid, 0, UUID_DCE);
 		strcpy(id->type_version, "1");
 		volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
 		return 0;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: libvolume_id: Support for GFS2 UUIDs
  2008-10-10 10:54 libvolume_id: Support for GFS2 UUIDs Steven Whitehouse
@ 2008-10-13  1:36 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2008-10-13  1:36 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Oct 10, 2008 at 12:54 PM, Steven Whitehouse <swhiteho@redhat.com> wrote:
>
> Here is a patch to add GFS2 UUID support to libvolume_id. Please
> consider applying,

Applied.

Thanks,
Kay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-13  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-10 10:54 libvolume_id: Support for GFS2 UUIDs Steven Whitehouse
2008-10-13  1:36 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox