From 6db77d2fe26e7c0f2f19ca84759dd198b27e0c99 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 14 Jan 2009 13:38:07 -0800 Subject: [PATCH] Add linux-ztest branch --- .topdeps | 4 +--- .topmsg | 17 ++--------------- cmd/ztest/ztest.c | 24 +++++++----------------- 3 files changed, 10 insertions(+), 35 deletions(-) diff --git a/.topdeps b/.topdeps index 607c231780..7f16cbcdd5 100644 --- a/.topdeps +++ b/.topdeps @@ -1,3 +1 @@ -gcc-branch -fix-branch -feature-branch +zfs-branch diff --git a/.topmsg b/.topmsg index e9722e1075..b607aee225 100644 --- a/.topmsg +++ b/.topmsg @@ -1,19 +1,6 @@ From: Brian Behlendorf -Subject: [PATCH] zfs branch +Subject: [PATCH] linux ztest -Merged result of all changes which are relevant to both Solaris -and Linux builds of the ZFS code. These are changes where there -is a reasonable chance they will be accepted upstream. - -Additionally, since this is effectively the root of the linux -ZFS tree the core linux build system is added here. This -includes autogen.sh, configure.ac, m4 macros, some scripts/*, -and makefiles for all the core ZFS components. Linux-only -features which require tweaks to the build system should appear -on the relevant topic branches. All autotools products which -result from autogen.sh are commited to the linux-configure-branch. - -This branch also contains the META, ChangeLog, AUTHORS, -README, and GIT files. +Minor changes to ztest for this environment. Signed-off-by: Brian Behlendorf diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index b270f982f7..caf1d3d0d1 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -2789,31 +2789,21 @@ static void ztest_verify_blocks(char *pool) { int status; + char bin[MAXPATHLEN + MAXNAMELEN + 20]; char zdb[MAXPATHLEN + MAXNAMELEN + 20]; char zbuf[1024]; - char *bin; - char *ztest; - char *isa; - int isalen; FILE *fp; - (void) realpath(getexecname(), zdb); + /* Designed to be run exclusively in the development tree */ + (void) realpath(getexecname(), bin); + strstr(bin, "/ztest/")[0] = '\0'; - /* zdb lives in /usr/sbin, while ztest lives in /usr/bin */ - bin = strstr(zdb, "/usr/bin/"); - ztest = strstr(bin, "/ztest"); - isa = bin + 8; - isalen = ztest - isa; - isa = strdup(isa); - /* LINTED */ - (void) sprintf(bin, - "/usr/sbin%.*s/zdb -bc%s%s -U /tmp/zpool.cache %s", - isalen, - isa, + (void) sprintf(zdb, + "%s/zdb/zdb -bc%s%s -U /tmp/zpool.cache %s", + bin, zopt_verbose >= 3 ? "s" : "", zopt_verbose >= 4 ? "v" : "", pool); - free(isa); if (zopt_verbose >= 5) (void) printf("Executing %s\n", strstr(zdb, "zdb "));