mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
zfs: replace tpool with taskq
They're basically the same thing; lets just carry one. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #17948
This commit is contained in:
committed by
Brian Behlendorf
parent
be7d8eaf54
commit
71609a9264
@@ -30,7 +30,6 @@ endif
|
||||
|
||||
libzutil_la_LIBADD = \
|
||||
libavl.la \
|
||||
libtpool.la \
|
||||
libnvpair.la \
|
||||
libspl.la
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <sys/efi_partition.h>
|
||||
#include <thread_pool.h>
|
||||
#include <libgeom.h>
|
||||
|
||||
#include <sys/vdev_impl.h>
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
#include <sys/vdev_impl.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
|
||||
#include <thread_pool.h>
|
||||
#include <libzutil.h>
|
||||
#include <libnvpair.h>
|
||||
#include <libzfs.h>
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
#include <sys/dktp/fdisk.h>
|
||||
#include <sys/vdev_impl.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
#include <sys/taskq.h>
|
||||
|
||||
#include <thread_pool.h>
|
||||
#include <libzutil.h>
|
||||
#include <libnvpair.h>
|
||||
|
||||
@@ -1457,7 +1457,7 @@ zpool_find_import_impl(libpc_handle_t *hdl, importargs_t *iarg,
|
||||
name_entry_t *ne, *nenext;
|
||||
rdsk_node_t *slice;
|
||||
void *cookie;
|
||||
tpool_t *t;
|
||||
taskq_t *tq;
|
||||
|
||||
verify(iarg->poolname == NULL || iarg->guid == 0);
|
||||
|
||||
@@ -1480,13 +1480,14 @@ zpool_find_import_impl(libpc_handle_t *hdl, importargs_t *iarg,
|
||||
threads = MIN(threads, am / VDEV_LABELS);
|
||||
#endif
|
||||
#endif
|
||||
t = tpool_create(1, threads, 0, NULL);
|
||||
tq = taskq_create("zpool_find_import", threads, minclsyspri, 1, INT_MAX,
|
||||
TASKQ_DYNAMIC);
|
||||
for (slice = avl_first(cache); slice;
|
||||
(slice = avl_walk(cache, slice, AVL_AFTER)))
|
||||
(void) tpool_dispatch(t, zpool_open_func, slice);
|
||||
(void) taskq_dispatch(tq, zpool_open_func, slice, TQ_SLEEP);
|
||||
|
||||
tpool_wait(t);
|
||||
tpool_destroy(t);
|
||||
taskq_wait(tq);
|
||||
taskq_destroy(tq);
|
||||
|
||||
/*
|
||||
* Process the cache, filtering out any entries which are not
|
||||
|
||||
Reference in New Issue
Block a user