Skip to content

Commit

Permalink
Review corrections, cleanup.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lundman committed Oct 18, 2022
1 parent 9ea880b commit 1332e14
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 24 deletions.
2 changes: 1 addition & 1 deletion include/libzutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions include/os/freebsd/spl/sys/mod_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions include/os/windows/spl/sys/mod_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 0 additions & 4 deletions include/sys/zfs_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
8 changes: 4 additions & 4 deletions lib/libzfs/os/linux/libzfs_pool_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
/*
Expand Down Expand Up @@ -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. */
Expand All @@ -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 "
Expand Down
6 changes: 0 additions & 6 deletions module/zfs/dmu_redact.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1332e14

Please sign in to comment.