public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - libgfs2: Remove unused library function
Date: Wed, 27 May 2009 10:22:00 -0000	[thread overview]
Message-ID: <20090527101947.C364F120364@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c87183b283fe2d0d2599722855321d6032fe88ae
Commit:        c87183b283fe2d0d2599722855321d6032fe88ae
Parent:        5cb749f78da0309cab91acaed80d57d8cf9efa29
Author:        Steven Whitehouse <swhiteho@redhat.com>
AuthorDate:    Fri May 22 15:11:25 2009 +0100
Committer:     Steven Whitehouse <swhiteho@redhat.com>
CommitterDate: Wed May 27 10:07:11 2009 +0100

libgfs2: Remove unused library function

mp2fsname2 is no longer used by anything.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
 gfs2/libgfs2/libgfs2.h |    1 -
 gfs2/libgfs2/misc.c    |   84 ------------------------------------------------
 2 files changed, 0 insertions(+), 85 deletions(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 9a07f56..a2a6a9b 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -642,7 +642,6 @@ extern int mount_gfs2_meta(struct gfs2_sbd *sdp);
 extern void cleanup_metafs(struct gfs2_sbd *sdp);
 extern char *find_debugfs_mount(void);
 extern char *mp2fsname(char *mp);
-extern char *mp2fsname2(char *mp);
 extern char *get_sysfs(const char *fsname, const char *filename);
 extern int get_sysfs_uint(const char *fsname, const char *filename, unsigned int *val);
 extern int set_sysfs(const char *fsname, const char *filename, const char *val);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 02c911e..ae30725 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -315,90 +315,6 @@ char *find_debugfs_mount(void)
 	return NULL;
 }
 
-/*
- * Same as mp2fsname, except that this function doesn't stat() the mountpoint
- * to get the device no. Used by gfs2_tool freeze/unfreeze where we don't want
- * to touch the potentially frozen filesytem and hang gfs2_tool itself.
- */
-char *
-mp2fsname2(char *mp)
-{
-	char device_id[PATH_MAX], *fsname = NULL;
-	struct stat statbuf;
-	DIR *d;
-	struct dirent *de;
-	FILE *fp;
-	char buffer[PATH_MAX], device_name[PATH_MAX];
-	int fsdump, fspass, ret, found = 0;
-	char fspath[PATH_MAX], fsoptions[PATH_MAX], fstype[80];
-	char *id;
-
-	/* Take care of trailing '/' */
-	if (mp[strlen(mp) - 1] == '/')
-		mp[strlen(mp) - 1] = 0;
-
-	fp = fopen("/proc/mounts", "r");
-	if (fp == NULL) {
-		return NULL;
-	}
-
-	while ((fgets(buffer, PATH_MAX - 1, fp)) != NULL) {
-		buffer[PATH_MAX - 1] = 0;
-		if (strstr(buffer, "0") == 0)
-			continue;
-
-		if ((ret = sscanf(buffer, "%s %s %s %s %d %d",
-				  device_name, fspath,
-				  fstype, fsoptions, &fsdump, &fspass)) != 6)
-			continue;
-
-		if (strcmp(fstype, "gfs2") != 0)
-			continue;
-
-		if (strcmp(fspath, mp) != 0)
-			continue;
-
-		found = 1;
-		break;
-	}
-	fclose(fp);
-
-	if (!found) {
-		errno = ENOENT;
-		return NULL;
-	}
-
-	if (stat(device_name, &statbuf))
-		return NULL;
-
-	memset(device_id, 0, sizeof(device_id));
-	sprintf(device_id, "%u:%u", (uint32_t)MAJOR(statbuf.st_rdev),
-		(uint32_t)MINOR(statbuf.st_rdev));
-
-	d = opendir(SYS_BASE);
-	if (!d)
-		return NULL;
-
-	while ((de = readdir(d))) {
-		if (de->d_name[0] == '.')
-			continue;
-
-		id = get_sysfs(de->d_name, "id");
-		if (!id)
-			continue;
-		if (strcmp(id, device_id) == 0) {
-			fsname = strdup(de->d_name);
-			break;
-		}
-	}
-
-	closedir(d);
-
-	if (!fsname)
-		errno = ENOENT;
-	return fsname;
-}
-
 /**
  * mp2fsname - Find the name for a filesystem given its mountpoint
  *


                 reply	other threads:[~2009-05-27 10:22 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=20090527101947.C364F120364@lists.fedorahosted.org \
    --to=swhiteho@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).