From 1fa5c7af3314b4c556bd86e3a49e3497a5ed72ed Mon Sep 17 00:00:00 2001 From: Arvind Sankar Date: Tue, 9 Jun 2020 18:59:04 -0400 Subject: [PATCH] Cleanup libzpool/kernel.c Commit ec213971274a ("async zvol minor node creation interferes with receive") replaced zvol_create_minors with zvol_create_minor and zvol_create_minors_recursive, changing the prototype at the same time. However the stub functions in libzpool/kernel.c were defined with the old prototype. As the definitions are empty, this doesn't cause any runtime issues, but an LTO build shows warnings because of the mismatched prototypes. Commit a0bd735adb1b ("Add support for asynchronous zvol minor operations") removed the real zvol_remove_minor, but for some reason added a stub implementation in libzpool/kernel.c with no references. Delete this dead code. Commit 196bee4cfd57 ("Remove deduplicated send/receive code") removed zfs_onexit_del_cb and zfs_onexit_cb_data. Drop the stubs as well. Add zvol.h include to provide prototypes, and sort the include directives. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Arvind Sankar Closes #10470 --- lib/libzpool/kernel.c | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index f19ebac1243f..10465ebfcac7 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -26,22 +26,24 @@ #include #include +#include #include #include #include #include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include #include -#include +#include /* * Emulation of kernel services in userland. @@ -973,20 +975,6 @@ zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data, return (0); } -/* ARGSUSED */ -int -zfs_onexit_del_cb(minor_t minor, uint64_t action_handle, boolean_t fire) -{ - return (0); -} - -/* ARGSUSED */ -int -zfs_onexit_cb_data(minor_t minor, uint64_t action_handle, void **data) -{ - return (0); -} - fstrans_cookie_t spl_fstrans_mark(void) { @@ -1013,17 +1001,12 @@ kmem_cache_reap_active(void) void *zvol_tag = "zvol_tag"; void -zvol_create_minor(spa_t *spa, const char *name, boolean_t async) +zvol_create_minor(const char *name) { } void -zvol_create_minors_recursive(spa_t *spa, const char *name, boolean_t async) -{ -} - -void -zvol_remove_minor(spa_t *spa, const char *name, boolean_t async) +zvol_create_minors_recursive(const char *name) { }