From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17753 invoked by alias); 22 May 2009 15:19:16 -0000 Received: (qmail 17744 invoked by alias); 22 May 2009 15:19:15 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Status: No, hits=-1.3 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: gfs2-utils: master - libgfs2: Remove unused library function To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: gfs2-utils.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 4e66208b9d855166303dbeb16bc06ecb88b10a7a X-Git-Newrev: 221712cf178897d65faeaf45a8e2de9a446083d3 From: Steven Whitehouse Message-Id: <20090522151844.CE1AD1201ED@lists.fedorahosted.org> Date: Fri, 22 May 2009 15:19: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/msg00388.txt.bz2 Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=221712cf178897d65faeaf45a8e2de9a446083d3 Commit: 221712cf178897d65faeaf45a8e2de9a446083d3 Parent: 4e66208b9d855166303dbeb16bc06ecb88b10a7a Author: Steven Whitehouse AuthorDate: Fri May 22 15:11:25 2009 +0100 Committer: Steven Whitehouse CommitterDate: Fri May 22 15:11:25 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 *