Skip to content

Commit

Permalink
Cleanup libzpool/kernel.c
Browse files Browse the repository at this point in the history
Commit
  ec21397 ("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
  a0bd735 ("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
  196bee4 ("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 <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes openzfs#10470
  • Loading branch information
nivedita76 authored and behlendorf committed Jun 18, 2020
1 parent f734301 commit 1fa5c7a
Showing 1 changed file with 12 additions and 29 deletions.
41 changes: 12 additions & 29 deletions lib/libzpool/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,24 @@

#include <assert.h>
#include <fcntl.h>
#include <libgen.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
#include <libgen.h>
#include <sys/spa.h>
#include <sys/stat.h>
#include <sys/crypto/icp.h>
#include <sys/processor.h>
#include <sys/zfs_context.h>
#include <sys/rrwlock.h>
#include <sys/utsname.h>
#include <sys/time.h>
#include <sys/spa.h>
#include <sys/stat.h>
#include <sys/systeminfo.h>
#include <sys/time.h>
#include <sys/utsname.h>
#include <sys/zfs_context.h>
#include <sys/zfs_onexit.h>
#include <sys/zvol.h>
#include <zfs_fletcher.h>
#include <sys/crypto/icp.h>
#include <zlib.h>

/*
* Emulation of kernel services in userland.
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
}

void
zvol_create_minors_recursive(spa_t *spa, const char *name, boolean_t async)
zvol_create_minor(const char *name)
{
}

void
zvol_remove_minor(spa_t *spa, const char *name, boolean_t async)
zvol_create_minors_recursive(const char *name)
{
}

Expand Down

0 comments on commit 1fa5c7a

Please sign in to comment.