From 462f86436500057837ca8029fc193a3114ba217f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 22:38:16 -0700 Subject: [PATCH 1/2] Check should be in ASSERT to minimize stack and prevent unused var. --- module/zfs/zio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 5c60b8c975..5de1d75a1f 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -1432,10 +1432,9 @@ zio_gang_tree_assemble_done(zio_t *zio) zio_t *lio = zio->io_logical; zio_gang_node_t *gn = zio->io_private; blkptr_t *bp = zio->io_bp; - zio_t *pio = zio_unique_parent(zio); int g; - ASSERT(pio == lio); + ASSERT(zio_unique_parent(zio) == lio); ASSERT(zio_walk_children(zio) == NULL); if (zio->io_error) From 1c0279a08f4f5a8cfa2947a085c919939df90891 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 22:43:09 -0700 Subject: [PATCH 2/2] Resolve newly revealed unused vars and symbols caused by topic branch. --- cmd/zfs/zfs_main.c | 4 ++++ cmd/zpool/zpool_main.c | 2 ++ module/zfs/zfs_ioctl.c | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 9d4bfc3cff..d3228e2269 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -817,7 +817,9 @@ out: static int destroy_callback(zfs_handle_t *zhp, void *data) { +#ifdef HAVE_ZPL destroy_cbdata_t *cbp = data; +#endif /* * Ignore pools (which we've already flagged as an error before getting @@ -4152,7 +4154,9 @@ main(int argc, char **argv) { int ret; int i; +#ifdef HAVE_ZPL char *progname; +#endif char *cmdname; (void) setlocale(LC_ALL, ""); diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 4ebdeaa445..b23098443f 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -697,7 +697,9 @@ zpool_do_create(int argc, char **argv) (strcmp(mountpoint, ZFS_MOUNTPOINT_LEGACY) != 0 && strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0)) { char buf[MAXPATHLEN]; +#ifdef HAVE_ZPL DIR *dirp; +#endif if (mountpoint && mountpoint[0] != '/') { (void) fprintf(stderr, gettext("invalid mountpoint " diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 3080cfc2a0..f57436e4e0 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -616,6 +616,7 @@ zfs_secpolicy_create(zfs_cmd_t *zc, cred_t *cr) return (error); } +#ifdef HAVE_ZPL static int zfs_secpolicy_umount(zfs_cmd_t *zc, cred_t *cr) { @@ -627,6 +628,7 @@ zfs_secpolicy_umount(zfs_cmd_t *zc, cred_t *cr) } return (error); } +#endif /* HAVE_ZPL */ /* * Policy for pool operations - create/destroy pools, add vdevs, etc. Requires @@ -1869,6 +1871,7 @@ zfs_ioc_remove_minor(zfs_cmd_t *zc) return (zvol_remove_minor(zc->zc_name)); } +#ifdef HAVE_ZPL /* * Search the vfs list for a specified resource. Returns a pointer to it * or NULL if no suitable entry is found. The caller of this routine @@ -1877,7 +1880,6 @@ zfs_ioc_remove_minor(zfs_cmd_t *zc) static vfs_t * zfs_get_vfs(const char *resource) { -#ifdef HAVE_ZPL struct vfs *vfsp; struct vfs *vfs_found = NULL; @@ -1893,10 +1895,8 @@ zfs_get_vfs(const char *resource) } while (vfsp != rootvfs); vfs_list_unlock(); return (vfs_found); -#else - return NULL; -#endif /* HAVE_ZPL */ } +#endif /* HAVE_ZPL */ /* ARGSUSED */ static void