From 1332e148c3385363f12b87aa176c04c4a1114a73 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Tue, 18 Oct 2022 15:10:01 +0900 Subject: [PATCH] Review corrections, cleanup. We had two versions of redact does not call bqueue destroy Left over module tunables Undo slash correction for Linux Signed-off-by: Jorgen Lundman --- include/libzutil.h | 2 +- include/os/freebsd/spl/sys/mod_os.h | 4 ---- include/os/windows/spl/sys/mod_os.h | 5 ----- include/sys/zfs_context.h | 4 ---- lib/libzfs/os/linux/libzfs_pool_os.c | 8 ++++---- module/zfs/dmu_redact.c | 6 ------ 6 files changed, 5 insertions(+), 24 deletions(-) diff --git a/include/libzutil.h b/include/libzutil.h index 6fee07541b98..af8dec263c83 100644 --- a/include/libzutil.h +++ b/include/libzutil.h @@ -111,7 +111,7 @@ _LIBZUTIL_H void update_vdev_config_dev_strs(nvlist_t *); #ifdef _WIN32 #define DISK_ROOT "\\\\?\\" #else -#define DISK_ROOT "/dev/" +#define DISK_ROOT "/dev" #endif #define UDISK_ROOT "/dev/disk" diff --git a/include/os/freebsd/spl/sys/mod_os.h b/include/os/freebsd/spl/sys/mod_os.h index e72bc410dc6f..62f08033191d 100644 --- a/include/os/freebsd/spl/sys/mod_os.h +++ b/include/os/freebsd/spl/sys/mod_os.h @@ -35,10 +35,6 @@ #define module_param(a, b, c) #define MODULE_PARM_DESC(a, b) -/* Other platforms have long as 32-bit */ -#define ZFS_MODULE_LONG long -#define ZFS_MODULE_ULONG unsigned long - #define ZMOD_RW CTLFLAG_RWTUN #define ZMOD_RD CTLFLAG_RDTUN diff --git a/include/os/windows/spl/sys/mod_os.h b/include/os/windows/spl/sys/mod_os.h index c45e971bd825..38235ba593b1 100644 --- a/include/os/windows/spl/sys/mod_os.h +++ b/include/os/windows/spl/sys/mod_os.h @@ -72,11 +72,6 @@ extern "C" { // Glancing at Linux kernel, module parameters limit: #define LINUX_MAX_MODULE_PARAM_LEN 1024 -/* This platform have long as 32-bit */ -/* We could check this with LP32 too */ -#define ZFS_MODULE_LONG int64_t -#define ZFS_MODULE_ULONG uint64_t - /* * The init/fini functions need to be called, but they are all static */ diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 4eadc94453f4..d29d7118ff00 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -210,10 +210,6 @@ typedef struct zfs_kernel_param { const char *name; /* unused stub */ } zfs_kernel_param_t; -/* Other platforms have long as 32-bit */ -#define ZFS_MODULE_LONG long -#define ZFS_MODULE_ULONG unsigned long - #define ZFS_MODULE_PARAM(scope_prefix, name_prefix, name, type, perm, desc) #define ZFS_MODULE_PARAM_ARGS void #define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, setfunc, \ diff --git a/lib/libzfs/os/linux/libzfs_pool_os.c b/lib/libzfs/os/linux/libzfs_pool_os.c index cc997ae75aae..40f0ca1d6b5f 100644 --- a/lib/libzfs/os/linux/libzfs_pool_os.c +++ b/lib/libzfs/os/linux/libzfs_pool_os.c @@ -104,7 +104,7 @@ read_efi_label(nvlist_t *config, diskaddr_t *sb) if (nvlist_lookup_string(config, ZPOOL_CONFIG_PATH, &path) != 0) return (err); - (void) snprintf(diskname, sizeof (diskname), "%s%s", DISK_ROOT, + (void) snprintf(diskname, sizeof (diskname), "%s/%s", DISK_ROOT, strrchr(path, '/')); if ((fd = open(diskname, O_RDONLY|O_DIRECT|O_CLOEXEC)) >= 0) { struct dk_gpt *vtoc; @@ -236,7 +236,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) start_block = NEW_START_BLOCK; } - (void) snprintf(path, sizeof (path), "%s%s", DISK_ROOT, name); + (void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name); if ((fd = open(path, O_RDWR|O_DIRECT|O_EXCL|O_CLOEXEC)) < 0) { /* @@ -315,7 +315,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) (void) close(fd); efi_free(vtoc); - (void) snprintf(path, sizeof (path), "%s%s", DISK_ROOT, name); + (void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name); (void) zfs_append_partition(path, MAXPATHLEN); /* Wait to udev to signal use the device has settled. */ @@ -327,7 +327,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) } /* We can't be to paranoid. Read the label back and verify it. */ - (void) snprintf(path, sizeof (path), "%s%s", DISK_ROOT, name); + (void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name); rval = zpool_label_disk_check(path); if (rval) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "freshly written " diff --git a/module/zfs/dmu_redact.c b/module/zfs/dmu_redact.c index 40fb05e6f482..7afcc1231348 100644 --- a/module/zfs/dmu_redact.c +++ b/module/zfs/dmu_redact.c @@ -825,12 +825,6 @@ perform_thread_merge(bqueue_t *q, uint32_t num_threads, kmem_free(redact_nodes, num_threads * sizeof (*redact_nodes)); if (current_record != NULL) bqueue_enqueue(q, current_record, sizeof (*current_record)); - - for (int i = 0; i < num_threads; i++) { - struct redact_thread_arg *targ = &thread_args[i]; - bqueue_destroy(&targ->q); - } - return (err); }