public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - libgfs2: Remove unused library function
@ 2009-05-27 10:22 Steven Whitehouse
0 siblings, 0 replies; only message in thread
From: Steven Whitehouse @ 2009-05-27 10:22 UTC (permalink / raw)
To: cluster-cvs-relay
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
*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-27 10:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-27 10:22 cluster: STABLE3 - libgfs2: Remove unused library function Steven Whitehouse
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).