From eb37fca59ef92e8ada79a2be24ad4ed90b3b3c95 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 8 Aug 2006 15:33:39 +0000 Subject: [PATCH] Cleanup some leftover turds from the days when volume managers new about XFS subvolumes (wasnt even useful code then, to be honest). Merge of master-melb:xfs-cmds:26730a by kenmcd. --- copy/xfs_copy.c | 2 -- db/init.c | 1 - growfs/xfs_growfs.c | 1 - include/libxfs.h | 2 -- libxfs/init.c | 75 ++------------------------------------------- logprint/logprint.c | 3 -- mkfs/xfs_mkfs.c | 1 - repair/init.c | 3 -- 8 files changed, 2 insertions(+), 86 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 6af8c0ec0..adeb60a91 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -651,10 +651,8 @@ main(int argc, char **argv) /* prepare the libxfs_init structure */ memset(&xargs, 0, sizeof(xargs)); - xargs.notvolmsg = "oh no %s"; xargs.isdirect = LIBXFS_DIRECT; xargs.isreadonly = LIBXFS_ISREADONLY; - xargs.notvolok = 1; if (source_is_file) { xargs.dname = source_name; diff --git a/db/init.c b/db/init.c index f2d60a9ed..8901fc74b 100644 --- a/db/init.c +++ b/db/init.c @@ -99,7 +99,6 @@ init( x.volname = fsdevice; else x.dname = fsdevice; - x.notvolok = 1; if (!libxfs_init(&x)) { fputs(_("\nfatal error -- couldn't initialize XFS library\n"), diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index ace64cbd9..5e7479f75 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -254,7 +254,6 @@ main(int argc, char **argv) xi.dname = datadev; xi.logname = logdev; xi.rtname = rtdev; - xi.notvolok = 1; xi.isreadonly = LIBXFS_ISREADONLY; if (!libxfs_init(&xi)) diff --git a/include/libxfs.h b/include/libxfs.h index 6ad5925eb..fa7cb9d6c 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -73,8 +73,6 @@ typedef struct { int lisfile; /* log "subvolume" is a regular file */ int lcreat; /* try to create log subvolume */ int risfile; /* realtime "subvolume" is a reg file */ int rcreat; /* try to create realtime subvolume */ - char *notvolmsg; /* format string for not XLV message */ - int notvolok; /* set if not XLV => try data */ int setblksize; /* attempt to set device blksize */ /* output results */ dev_t ddev; /* device for data subvolume */ diff --git a/libxfs/init.c b/libxfs/init.c index e5d4b9850..21d040aba 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -245,80 +245,9 @@ libxfs_init(libxfs_init_t *a) goto done; needcd = 1; fd = open(rawfile, O_RDONLY); -#ifdef HAVE_VOLUME_MANAGER - xlv_getdev_t getdev; - if (ioctl(fd, DIOCGETVOLDEV, &getdev) < 0) -#else - if (1) -#endif - { - if (a->notvolok) { - dname = a->dname = a->volname; - a->volname = NULL; - goto voldone; - } - fprintf(stderr, _("%s: " - "%s is not a volume device name\n"), - progname, a->volname); - if (a->notvolmsg) - fprintf(stderr, a->notvolmsg, a->volname); - goto done; - } -#ifdef HAVE_VOLUME_MANAGER - if (getdev.data_subvol_dev && dname) { - fprintf(stderr, _("%s: " - "%s has a data subvolume, cannot specify %s\n"), - progname, a->volname, dname); - goto done; - } - if (getdev.log_subvol_dev && logname) { - fprintf(stderr, _("%s: " - "%s has a log subvolume, cannot specify %s\n"), - progname, a->volname, logname); - goto done; - } - if (getdev.rt_subvol_dev && rtname) { - fprintf(stderr, _("%s: %s has a realtime subvolume, " - "cannot specify %s\n"), - progname, a->volname, rtname); - goto done; - } - if (!dname && getdev.data_subvol_dev) { - strcpy(dpath, "/tmp/libxfsdXXXXXX"); - (void)mktemp(dpath); - if (mknod(dpath, S_IFCHR | 0600, - getdev.data_subvol_dev) < 0) { - fprintf(stderr, _("%s: mknod failed: %s\n"), - progname, strerror(errno)); - goto done; - } - dname = dpath; - } - if (!logname && getdev.log_subvol_dev) { - strcpy(logpath, "/tmp/libxfslXXXXXX"); - (void)mktemp(logpath); - if (mknod(logpath, S_IFCHR | 0600, - getdev.log_subvol_dev) < 0) { - fprintf(stderr, _("%s: mknod failed: %s\n"), - progname, strerror(errno)); - goto done; - } - logname = logpath; - } - if (!rtname && getdev.rt_subvol_dev) { - strcpy(rtpath, "/tmp/libxfsrXXXXXX"); - (void)mktemp(rtpath); - if (mknod(rtpath, S_IFCHR | 0600, - getdev.rt_subvol_dev) < 0) { - fprintf(stderr, _("%s: mknod failed: %s\n"), - progname, strerror(errno)); - goto done; - } - rtname = rtpath; - } -#endif + dname = a->dname = a->volname; + a->volname = NULL; } -voldone: if (dname) { if (dname[0] != '/' && needcd) chdir(curdir); diff --git a/logprint/logprint.c b/logprint/logprint.c index a9ddb3fd4..29de24136 100644 --- a/logprint/logprint.c +++ b/logprint/logprint.c @@ -204,10 +204,7 @@ main(int argc, char **argv) if (x.dname == NULL) usage(); - x.notvolok = 1; x.isreadonly = LIBXFS_ISINACTIVE; - x.notvolmsg = "You should never see this message.\n"; - printf("xfs_logprint:\n"); if (!libxfs_init(&x)) exit(1); diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 51997fc33..0042c344c 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -634,7 +634,6 @@ main( bzero(&fsx, sizeof(fsx)); bzero(&xi, sizeof(xi)); - xi.notvolok = 1; xi.setblksize = 1; xi.isdirect = LIBXFS_DIRECT; xi.isreadonly = LIBXFS_EXCLUSIVELY; diff --git a/repair/init.c b/repair/init.c index 75f1f746a..090ebea39 100644 --- a/repair/init.c +++ b/repair/init.c @@ -126,10 +126,7 @@ xfs_init(libxfs_init_t *args) /* XXX assume data file also means rt file */ } - args->notvolmsg = _("you should never get this message - %s"); - args->notvolok = 1; args->setblksize = !dangerously; - args->isdirect = LIBXFS_DIRECT; if (no_modify) args->isreadonly = (LIBXFS_ISREADONLY | LIBXFS_ISINACTIVE); -- 2.47.2