cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: fabbione@sourceware.org <fabbione@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Cluster Project branch, master, updated. gfs-kernel_0_1_22-91-gf61b789
Date: 21 Mar 2008 04:07:02 -0000	[thread overview]
Message-ID: <20080321040702.6272.qmail@sourceware.org> (raw)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=f61b7891dfeab418bd1a20a12f084e848df335fc

The branch, master has been updated
       via  f61b7891dfeab418bd1a20a12f084e848df335fc (commit)
      from  3a0c7d3e8b81ca339fbab9fb8d17f76991b1e358 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f61b7891dfeab418bd1a20a12f084e848df335fc
Author: Fabio M. Di Nitto <fabbione@fabbione.net>
Date:   Fri Mar 21 05:05:43 2008 +0100

    [CMAN] Drop dependency on libdevmapper
    
    Signed-off-by: Fabio M. Di Nitto <fabbione@fabbione.net>

-----------------------------------------------------------------------

Summary of changes:
 cman/qdisk/Makefile   |    8 +-----
 cman/qdisk/scandisk.c |   54 +++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/cman/qdisk/Makefile b/cman/qdisk/Makefile
index e587941..4d3634d 100644
--- a/cman/qdisk/Makefile
+++ b/cman/qdisk/Makefile
@@ -30,10 +30,7 @@ CFLAGS += -I$(S)
 CFLAGS += -I${incdir}
 
 EXTRA_LDFLAGS += -L${cmanlibdir} -L${ccslibdir} -lcman -lccs
-#
-# XXX Fabio has a way to clean up the devmapper requirement
-#
-EXTRA_LDFLAGS += -lpthread -ldevmapper
+EXTRA_LDFLAGS += -lpthread
 
 OBJS1=	main.o \
 	score.o \
@@ -54,9 +51,8 @@ SHAREDOBJS= disk.o \
 ${TARGET1}: ${SHAREDOBJS} ${OBJS1}
 	$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
 
-# XXX Remove $(EXTRA_LDFLAGS) when libdevmapper is no longer required
 ${TARGET2}: ${SHAREDOBJS} ${OBJS2}
-	$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
+	$(CC) -o $@ $^ $(LDFLAGS)
 
 depends:
 	$(MAKE) -C ../lib all
diff --git a/cman/qdisk/scandisk.c b/cman/qdisk/scandisk.c
index b0bd8a6..f4f7e0d 100644
--- a/cman/qdisk/scandisk.c
+++ b/cman/qdisk/scandisk.c
@@ -19,7 +19,6 @@
 #include <dirent.h>
 #include <sys/sysmacros.h>
 #include <sys/stat.h>
-#include <libdevmapper.h>
 
 #include "scandisk.h"
 
@@ -393,25 +392,58 @@ static int scanmdstat(struct devlisthead *devlisthead)
 	return 1;
 }
 
-/* TODO: add more stuff from devmapper to understand if a maj/min
- * 	 is a slave or a holder. If we have sysfs this is of no use.
- */
-
-/* scanmapper uses libdevmapper to identify devices that are not real
+/* scanmapper parses /proc/devices to identify what maj are associated
+ * with device-mapper
  *
  * ret:
  * can't fail for now
  */
 static int scanmapper(struct devlisthead *devlisthead)
 {
-	struct devnode *startnode = devlisthead->devnode;
+	struct devnode *startnode;
+	FILE *fp;
+	char line[4096];
+	char major[4];
+	char device[64];
+	int maj, start = 0;
+
+	fp = fopen("/proc/devices", "r");
+	if (!fp)
+		return 0;
+
+	while (fgets(line, sizeof(line), fp) != NULL) {
+		memset(major, 0, 4);
+		memset(device, 0, 64);
+
+		if (strlen(line) > 4096)
+			continue;
+
+		if (!strncmp(line, "Block devices:", 13)) {
+			start = 1;
+			continue;
+		}
+
+		if (!start)
+			continue;
+
+		sscanf(line, "%s %s", major, device);
+
+		if (!strncmp(device, "device-mapper", 13)) {
+			maj = atoi(major);
+			startnode = devlisthead->devnode;
+
+			while (startnode) {
+				if (startnode->maj == maj)
+					startnode->mapper = 1;
+
+				startnode = startnode->next;
+			}
+
+		}
 
-	while (startnode) {
-		if (dm_is_dm_major(startnode->maj) > 0)
-			startnode->mapper = 1;
-		startnode = startnode->next;
 	}
 
+	fclose(fp);
 	return 1;
 }
 


hooks/post-receive
--
Cluster Project



                 reply	other threads:[~2008-03-21  4:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080321040702.6272.qmail@sourceware.org \
    --to=fabbione@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).