From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25015 invoked by alias); 27 May 2009 10:22:44 -0000 Received: (qmail 25008 invoked by alias); 27 May 2009 10:22:43 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - libgfs2: Remove unused library function To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 5cb749f78da0309cab91acaed80d57d8cf9efa29 X-Git-Newrev: c87183b283fe2d0d2599722855321d6032fe88ae From: Steven Whitehouse Message-Id: <20090527101947.C364F120364@lists.fedorahosted.org> Date: Wed, 27 May 2009 10:22:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00422.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c87183b283fe2d0d2599722855321d6032fe88ae Commit: c87183b283fe2d0d2599722855321d6032fe88ae Parent: 5cb749f78da0309cab91acaed80d57d8cf9efa29 Author: Steven Whitehouse AuthorDate: Fri May 22 15:11:25 2009 +0100 Committer: Steven Whitehouse 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 --- 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 *