From 3eaf76a8d2a6fb9bfaeca888bfd20535d7e1e71b Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Mon, 17 Aug 2020 14:02:32 -0400 Subject: Fix l2arc_dev_rebuild_start thread name `thread_create` on FreeBSD stringifies the argument passed as the thread function to create a name for the thread. The thread name for `l2arc_dev_rebuild_start` ended up with `(void (*)(void *))` in it. Change the type signature so the function does not need to be cast when creating the thread. Rename the function to `l2arc_dev_rebuild_thread` for clarity and consistency, as well. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Reviewed-by: George Amanakis Signed-off-by: Ryan Moeller Closes #10716 --- module/zfs/arc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/zfs') diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 19ad42d29..06c2d5fac 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -920,7 +920,7 @@ unsigned long l2arc_rebuild_blocks_min_l2size = 1024 * 1024 * 1024; /* L2ARC persistence rebuild control routines. */ void l2arc_rebuild_vdev(vdev_t *vd, boolean_t reopen); -static void l2arc_dev_rebuild_start(l2arc_dev_t *dev); +static void l2arc_dev_rebuild_thread(void *arg); static int l2arc_rebuild(l2arc_dev_t *dev); /* L2ARC persistence read I/O routines. */ @@ -9500,8 +9500,7 @@ l2arc_spa_rebuild_start(spa_t *spa) mutex_enter(&l2arc_rebuild_thr_lock); if (dev->l2ad_rebuild && !dev->l2ad_rebuild_cancel) { dev->l2ad_rebuild_began = B_TRUE; - (void) thread_create(NULL, 0, - (void (*)(void *))l2arc_dev_rebuild_start, + (void) thread_create(NULL, 0, l2arc_dev_rebuild_thread, dev, 0, &p0, TS_RUN, minclsyspri); } mutex_exit(&l2arc_rebuild_thr_lock); @@ -9512,8 +9511,10 @@ l2arc_spa_rebuild_start(spa_t *spa) * Main entry point for L2ARC rebuilding. */ static void -l2arc_dev_rebuild_start(l2arc_dev_t *dev) +l2arc_dev_rebuild_thread(void *arg) { + l2arc_dev_t *dev = arg; + VERIFY(!dev->l2ad_rebuild_cancel); VERIFY(dev->l2ad_rebuild); (void) l2arc_rebuild(dev); -- cgit v1.2.3