aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrooks Davis <[email protected]>2022-10-27 23:20:05 +0100
committerBrian Behlendorf <[email protected]>2022-11-03 09:52:12 -0700
commit250b2bac78102f707dc105450f25d91e5fab481e (patch)
tree4bb21f866d060d7cd38f34a35057053603818431
parentd96303cb0787bf7217aacd51074e00d820a98700 (diff)
zfs_onexit_add_cb: make action_handle point to a uintptr_t
Avoid assuming than a uint64_t can hold a pointer and reduce the number of casts in the process. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Richard Yao <[email protected]> Signed-off-by: Brooks Davis <[email protected]> Closes #14131
-rw-r--r--include/sys/zfs_onexit.h2
-rw-r--r--lib/libzpool/kernel.c2
-rw-r--r--module/zfs/zfs_onexit.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/include/sys/zfs_onexit.h b/include/sys/zfs_onexit.h
index 18930fe01..91f49d4cc 100644
--- a/include/sys/zfs_onexit.h
+++ b/include/sys/zfs_onexit.h
@@ -54,7 +54,7 @@ extern void zfs_onexit_destroy(zfs_onexit_t *zo);
extern zfs_file_t *zfs_onexit_fd_hold(int fd, minor_t *minorp);
extern void zfs_onexit_fd_rele(zfs_file_t *);
extern int zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
- uint64_t *action_handle);
+ uintptr_t *action_handle);
#ifdef __cplusplus
}
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index 1d4647094..77264470b 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -1001,7 +1001,7 @@ zfs_onexit_fd_rele(zfs_file_t *fp)
int
zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
- uint64_t *action_handle)
+ uintptr_t *action_handle)
{
(void) minor, (void) func, (void) data, (void) action_handle;
return (0);
diff --git a/module/zfs/zfs_onexit.c b/module/zfs/zfs_onexit.c
index dfcdeeb5b..63acf7ab2 100644
--- a/module/zfs/zfs_onexit.c
+++ b/module/zfs/zfs_onexit.c
@@ -151,7 +151,7 @@ zfs_onexit_minor_to_state(minor_t minor, zfs_onexit_t **zo)
*/
int
zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
- uint64_t *action_handle)
+ uintptr_t *action_handle)
{
zfs_onexit_t *zo;
zfs_onexit_action_node_t *ap;
@@ -170,7 +170,7 @@ zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
list_insert_tail(&zo->zo_actions, ap);
mutex_exit(&zo->zo_lock);
if (action_handle)
- *action_handle = (uint64_t)(uintptr_t)ap;
+ *action_handle = (uintptr_t)ap;
return (0);
}