aboutsummaryrefslogtreecommitdiffstats
path: root/main/zfs-hardened/pax-rap-fixes.patch
blob: a21cc3f4bc6ae2a4d49da8b8b0ceac5dd13600d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 4fe35342d..75bd560a2 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -242,7 +242,7 @@ typedef struct kthread {
 #define	getcomm()			"unknown"
 #define	thread_exit			zk_thread_exit
 #define	thread_create(stk, stksize, func, arg, len, pp, state, pri)	\
-	zk_thread_create(stk, stksize, (thread_func_t)func, arg,	\
+	zk_thread_create(stk, stksize, func, arg,	\
 	    len, NULL, state, pri, PTHREAD_CREATE_DETACHED)
 #define	thread_join(t)			zk_thread_join(t)
 #define	newproc(f, a, cid, pri, ctp, pid)	(ENOSYS)
diff --git a/include/sys/zio.h b/include/sys/zio.h
index 4eaabc38c..a7c2346f1 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -522,8 +522,8 @@ extern void zio_shrink(zio_t *zio, uint64_t size);
 
 extern int zio_wait(zio_t *zio);
 extern void zio_nowait(zio_t *zio);
-extern void zio_execute(zio_t *zio);
-extern void zio_interrupt(zio_t *zio);
+extern void zio_execute(void *zio);
+extern void zio_interrupt(void *zio);
 extern void zio_delay_init(zio_t *zio);
 extern void zio_delay_interrupt(zio_t *zio);
 
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index a26e1156c..2a5aeb272 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -4214,7 +4214,7 @@ arc_kmem_reap_now(void)
  * using mutex_tryenter() from arc_reclaim_thread().
  */
 static void
-arc_reclaim_thread(void)
+arc_reclaim_thread(void *_unused)
 {
 	fstrans_cookie_t	cookie = spl_fstrans_mark();
 	hrtime_t		growtime = 0;
@@ -7521,7 +7521,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
  * heart of the L2ARC.
  */
 static void
-l2arc_feed_thread(void)
+l2arc_feed_thread(void *_unused)
 {
 	callb_cpr_t cpr;
 	l2arc_dev_t *dev;
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
index dc2c00495..9b322d0de 100644
--- a/module/zfs/dbuf.c
+++ b/module/zfs/dbuf.c
@@ -531,7 +531,7 @@ dbuf_evict_one(void)
  * out of the cache it is destroyed and becomes eligible for arc eviction.
  */
 static void
-dbuf_evict_thread(void)
+dbuf_evict_thread(void *unused)
 {
 	callb_cpr_t cpr;
 
@@ -1977,7 +1977,6 @@ dmu_buf_will_fill(dmu_buf_t *db_fake, dmu_tx_t *tx)
 	(void) dbuf_dirty(db, tx);
 }
 
-#pragma weak dmu_buf_fill_done = dbuf_fill_done
 /* ARGSUSED */
 void
 dbuf_fill_done(dmu_buf_impl_t *db, dmu_tx_t *tx)
@@ -1999,6 +1998,12 @@ dbuf_fill_done(dmu_buf_impl_t *db, dmu_tx_t *tx)
 	mutex_exit(&db->db_mtx);
 }
 
+void __weak
+dmu_buf_fill_done(dmu_buf_t *db, dmu_tx_t *tx)
+{
+	dbuf_fill_done((dmu_buf_impl_t *)db, tx);
+}
+
 void
 dmu_buf_write_embedded(dmu_buf_t *dbuf, void *data,
     bp_embedded_type_t etype, enum zio_compress comp,
@@ -2821,7 +2826,6 @@ dbuf_rm_spill(dnode_t *dn, dmu_tx_t *tx)
 	dbuf_free_range(dn, DMU_SPILL_BLKID, DMU_SPILL_BLKID, tx);
 }
 
-#pragma weak dmu_buf_add_ref = dbuf_add_ref
 void
 dbuf_add_ref(dmu_buf_impl_t *db, void *tag)
 {
@@ -2829,6 +2833,14 @@ dbuf_add_ref(dmu_buf_impl_t *db, void *tag)
 	VERIFY3S(holds, >, 1);
 }
 
+void __weak
+dmu_buf_add_ref(dmu_buf_t *_db, void* tag)
+{
+	dmu_buf_impl_t *db = (dmu_buf_impl_t *)_db;
+	dbuf_add_ref(db, tag);
+}
+
+
 #pragma weak dmu_buf_try_add_ref = dbuf_try_add_ref
 boolean_t
 dbuf_try_add_ref(dmu_buf_t *db_fake, objset_t *os, uint64_t obj, uint64_t blkid,
@@ -2985,13 +2997,18 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag)
 
 }
 
-#pragma weak dmu_buf_refcount = dbuf_refcount
 uint64_t
 dbuf_refcount(dmu_buf_impl_t *db)
 {
 	return (refcount_count(&db->db_holds));
 }
 
+uint64_t __weak
+dmu_buf_refcount(dmu_buf_t *db)
+{
+	return dbuf_refcount((dmu_buf_impl_t *)db);
+}
+
 void *
 dmu_buf_replace_user(dmu_buf_t *db_fake, dmu_buf_user_t *old_user,
     dmu_buf_user_t *new_user)
diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c
index 00478a39f..a6ee136e0 100644
--- a/module/zfs/mmp.c
+++ b/module/zfs/mmp.c
@@ -123,7 +123,7 @@ uint_t zfs_multihost_import_intervals = MMP_DEFAULT_IMPORT_INTERVALS;
  */
 uint_t zfs_multihost_fail_intervals = MMP_DEFAULT_FAIL_INTERVALS;
 
-static void mmp_thread(spa_t *spa);
+static void mmp_thread(void *spa);
 
 void
 mmp_init(spa_t *spa)
@@ -364,8 +364,9 @@ mmp_write_uberblock(spa_t *spa)
 }
 
 static void
-mmp_thread(spa_t *spa)
+mmp_thread(void *arg)
 {
+	spa_t *spa = arg;
 	mmp_thread_t *mmp = &spa->spa_mmp;
 	boolean_t last_spa_suspended = spa_suspended(spa);
 	boolean_t last_spa_multihost = spa_multihost(spa);
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index f1f1444f1..3cb73e977 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -6068,8 +6068,9 @@ spa_async_autoexpand(spa_t *spa, vdev_t *vd)
 }
 
 static void
-spa_async_thread(spa_t *spa)
+spa_async_thread(void *arg)
 {
+	spa_t *spa = arg;
 	int tasks, i;
 
 	ASSERT(spa->spa_sync_on);
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index 65bd7f93a..87b68f576 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -108,8 +108,8 @@
  * now transition to the syncing state.
  */
 
-static void txg_sync_thread(dsl_pool_t *dp);
-static void txg_quiesce_thread(dsl_pool_t *dp);
+static void txg_sync_thread(void *arg);
+static void txg_quiesce_thread(void *arg);
 
 int zfs_txg_timeout = 5;	/* max seconds worth of delta per txg */
 
@@ -408,8 +408,9 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg)
 }
 
 static void
-txg_do_callbacks(list_t *cb_list)
+txg_do_callbacks(void *_cb_list)
 {
+	list_t *cb_list = _cb_list;
 	dmu_tx_do_callbacks(cb_list, 0);
 
 	list_destroy(cb_list);
@@ -457,7 +458,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg)
 
 		list_move_tail(cb_list, &tc->tc_callbacks[g]);
 
-		(void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *)
+		(void) taskq_dispatch(tx->tx_commit_cb_taskq,
 		    txg_do_callbacks, cb_list, TQ_SLEEP);
 	}
 }
@@ -477,8 +478,9 @@ txg_wait_callbacks(dsl_pool_t *dp)
 }
 
 static void
-txg_sync_thread(dsl_pool_t *dp)
+txg_sync_thread(void *arg)
 {
+	dsl_pool_t *dp = arg;
 	spa_t *spa = dp->dp_spa;
 	tx_state_t *tx = &dp->dp_tx;
 	callb_cpr_t cpr;
@@ -561,8 +563,9 @@ txg_sync_thread(dsl_pool_t *dp)
 }
 
 static void
-txg_quiesce_thread(dsl_pool_t *dp)
+txg_quiesce_thread(void *arg)
 {
+	dsl_pool_t *dp = arg;
 	tx_state_t *tx = &dp->dp_tx;
 	callb_cpr_t cpr;
 
diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c
index 30efb4b57..7a837f8a0 100644
--- a/module/zfs/zfs_replay.c
+++ b/module/zfs/zfs_replay.c
@@ -72,7 +72,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode,
 
 /* ARGSUSED */
 static int
-zfs_replay_error(zfsvfs_t *zfsvfs, lr_t *lr, boolean_t byteswap)
+zfs_replay_error(void *zsb, char *lr, boolean_t byteswap)
 {
 	return (SET_ERROR(ENOTSUP));
 }
@@ -265,9 +265,10 @@ zfs_replay_swap_attrs(lr_attr_t *lrattr)
  * as option FUID information.
  */
 static int
-zfs_replay_create_acl(zfsvfs_t *zfsvfs,
-    lr_acl_create_t *lracl, boolean_t byteswap)
+zfs_replay_create_acl(void *_zfsvfs, char *_lracl, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_acl_create_t *lracl = (lr_acl_create_t *)_lracl;
 	char *name = NULL;		/* location determined later */
 	lr_create_t *lr = (lr_create_t *)lracl;
 	znode_t *dzp;
@@ -413,8 +414,10 @@ bail:
 }
 
 static int
-zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap)
+zfs_replay_create(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_create_t *lr = (lr_create_t *)_lr;
 	char *name = NULL;		/* location determined later */
 	char *link;			/* symlink content follows name */
 	znode_t *dzp;
@@ -545,8 +548,10 @@ out:
 }
 
 static int
-zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
+zfs_replay_remove(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_remove_t *lr = (lr_remove_t *)_lr;
 	char *name = (char *)(lr + 1);	/* name follows lr_remove_t */
 	znode_t *dzp;
 	int error;
@@ -578,8 +583,10 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap)
+zfs_replay_link(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_link_t *lr = (lr_link_t *)_lr;
 	char *name = (char *)(lr + 1);	/* name follows lr_link_t */
 	znode_t *dzp, *zp;
 	int error;
@@ -608,8 +615,10 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
+zfs_replay_rename(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_rename_t *lr = (lr_rename_t *)_lr;
 	char *sname = (char *)(lr + 1);	/* sname and tname follow lr_rename_t */
 	char *tname = sname + strlen(sname) + 1;
 	znode_t *sdzp, *tdzp;
@@ -639,8 +648,10 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
+zfs_replay_write(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_write_t *lr = (lr_write_t *)_lr;
 	char *data = (char *)(lr + 1);	/* data follows lr_write_t */
 	znode_t	*zp;
 	int error, written;
@@ -708,8 +719,10 @@ zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
  * the file is grown.
  */
 static int
-zfs_replay_write2(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
+zfs_replay_write2(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_write_t *lr = (lr_write_t *)_lr;
 	znode_t	*zp;
 	int error;
 	uint64_t end;
@@ -753,8 +766,10 @@ top:
 }
 
 static int
-zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *lr, boolean_t byteswap)
+zfs_replay_truncate(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_truncate_t *lr = (lr_truncate_t *)_lr;
 	znode_t *zp;
 	flock64_t fl;
 	int error;
@@ -780,8 +795,10 @@ zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap)
+zfs_replay_setattr(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_setattr_t *lr = (lr_setattr_t *)_lr;
 	znode_t *zp;
 	xvattr_t xva;
 	vattr_t *vap = &xva.xva_vattr;
@@ -834,8 +851,10 @@ zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, boolean_t byteswap)
+zfs_replay_acl_v0(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_acl_v0_t *lr = (lr_acl_v0_t *)_lr;
 	ace_t *ace = (ace_t *)(lr + 1);	/* ace array follows lr_acl_t */
 	vsecattr_t vsa;
 	znode_t *zp;
@@ -878,8 +897,10 @@ zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, boolean_t byteswap)
  *
  */
 static int
-zfs_replay_acl(zfsvfs_t *zfsvfs, lr_acl_t *lr, boolean_t byteswap)
+zfs_replay_acl(void *_zfsvfs, char *_lr, boolean_t byteswap)
 {
+	zfsvfs_t *zfsvfs = _zfsvfs;
+	lr_acl_t *lr = (lr_acl_t *)_lr;
 	ace_t *ace = (ace_t *)(lr + 1);
 	vsecattr_t vsa;
 	znode_t *zp;
@@ -929,25 +950,25 @@ zfs_replay_acl(zfsvfs_t *zfsvfs, lr_acl_t *lr, boolean_t byteswap)
  * Callback vectors for replaying records
  */
 zil_replay_func_t zfs_replay_vector[TX_MAX_TYPE] = {
-	(zil_replay_func_t)zfs_replay_error,		/* no such type */
-	(zil_replay_func_t)zfs_replay_create,		/* TX_CREATE */
-	(zil_replay_func_t)zfs_replay_create,		/* TX_MKDIR */
-	(zil_replay_func_t)zfs_replay_create,		/* TX_MKXATTR */
-	(zil_replay_func_t)zfs_replay_create,		/* TX_SYMLINK */
-	(zil_replay_func_t)zfs_replay_remove,		/* TX_REMOVE */
-	(zil_replay_func_t)zfs_replay_remove,		/* TX_RMDIR */
-	(zil_replay_func_t)zfs_replay_link,		/* TX_LINK */
-	(zil_replay_func_t)zfs_replay_rename,		/* TX_RENAME */
-	(zil_replay_func_t)zfs_replay_write,		/* TX_WRITE */
-	(zil_replay_func_t)zfs_replay_truncate,		/* TX_TRUNCATE */
-	(zil_replay_func_t)zfs_replay_setattr,		/* TX_SETATTR */
-	(zil_replay_func_t)zfs_replay_acl_v0,		/* TX_ACL_V0 */
-	(zil_replay_func_t)zfs_replay_acl,		/* TX_ACL */
-	(zil_replay_func_t)zfs_replay_create_acl,	/* TX_CREATE_ACL */
-	(zil_replay_func_t)zfs_replay_create,		/* TX_CREATE_ATTR */
-	(zil_replay_func_t)zfs_replay_create_acl,	/* TX_CREATE_ACL_ATTR */
-	(zil_replay_func_t)zfs_replay_create_acl,	/* TX_MKDIR_ACL */
-	(zil_replay_func_t)zfs_replay_create,		/* TX_MKDIR_ATTR */
-	(zil_replay_func_t)zfs_replay_create_acl,	/* TX_MKDIR_ACL_ATTR */
-	(zil_replay_func_t)zfs_replay_write2,		/* TX_WRITE2 */
+	zfs_replay_error,		/* no such type */
+	zfs_replay_create,		/* TX_CREATE */
+	zfs_replay_create,		/* TX_MKDIR */
+	zfs_replay_create,		/* TX_MKXATTR */
+	zfs_replay_create,		/* TX_SYMLINK */
+	zfs_replay_remove,		/* TX_REMOVE */
+	zfs_replay_remove,		/* TX_RMDIR */
+	zfs_replay_link,		/* TX_LINK */
+	zfs_replay_rename,		/* TX_RENAME */
+	zfs_replay_write,		/* TX_WRITE */
+	zfs_replay_truncate,		/* TX_TRUNCATE */
+	zfs_replay_setattr,		/* TX_SETATTR */
+	zfs_replay_acl_v0,		/* TX_ACL_V0 */
+	zfs_replay_acl,		/* TX_ACL */
+	zfs_replay_create_acl,	/* TX_CREATE_ACL */
+	zfs_replay_create,		/* TX_CREATE_ATTR */
+	zfs_replay_create_acl,	/* TX_CREATE_ACL_ATTR */
+	zfs_replay_create_acl,	/* TX_MKDIR_ACL */
+	zfs_replay_create,		/* TX_MKDIR_ATTR */
+	zfs_replay_create_acl,	/* TX_MKDIR_ACL_ATTR */
+	zfs_replay_write2,		/* TX_WRITE2 */
 };
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index d415e8024..128a96cc8 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -943,6 +943,13 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
 	return (0);
 }
 
+static void
+iput_wrapper(void *_i)
+{
+	struct inode *i = _i;
+	iput(i);
+}
+
 /*
  * Drop a reference on the passed inode asynchronously. This ensures
  * that the caller will never drop the last reference on an inode in
@@ -959,7 +966,7 @@ zfs_iput_async(struct inode *ip)
 
 	if (atomic_read(&ip->i_count) == 1)
 		VERIFY(taskq_dispatch(dsl_pool_iput_taskq(dmu_objset_pool(os)),
-		    (task_func_t *)iput, ip, TQ_SLEEP) != TASKQID_INVALID);
+		    iput_wrapper, ip, TQ_SLEEP) != TASKQID_INVALID);
 	else
 		iput(ip);
 }
diff --git a/module/zfs/zil.c b/module/zfs/zil.c
index 6a1f190f5..e9c71b5b0 100644
--- a/module/zfs/zil.c
+++ b/module/zfs/zil.c
@@ -1240,8 +1240,9 @@ zil_itx_destroy(itx_t *itx)
  * so no locks are needed.
  */
 static void
-zil_itxg_clean(itxs_t *itxs)
+zil_itxg_clean(void *data)
 {
+	itxs_t *itxs = data;
 	itx_t *itx;
 	list_t *list;
 	avl_tree_t *t;
@@ -1445,7 +1446,7 @@ zil_clean(zilog_t *zilog, uint64_t synced_txg)
 	 * created a bad performance problem.
 	 */
 	if (taskq_dispatch(zilog->zl_clean_taskq,
-	    (void (*)(void *))zil_itxg_clean, clean_me, TQ_NOSLEEP) == 0)
+	    zil_itxg_clean, clean_me, TQ_NOSLEEP) == 0)
 		zil_itxg_clean(clean_me);
 }
 
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 82e801e83..af20983ad 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -1512,7 +1512,7 @@ zio_taskq_dispatch(zio_t *zio, zio_taskq_type_t q, boolean_t cutinline)
 	 * to dispatch the zio to another taskq at the same time.
 	 */
 	ASSERT(taskq_empty_ent(&zio->io_tqent));
-	spa_taskq_dispatch_ent(spa, t, q, (task_func_t *)zio_execute, zio,
+	spa_taskq_dispatch_ent(spa, t, q, zio_execute, zio,
 	    flags, &zio->io_tqent);
 }
 
@@ -1544,9 +1544,9 @@ zio_issue_async(zio_t *zio)
 }
 
 void
-zio_interrupt(zio_t *zio)
+zio_interrupt(void *zio)
 {
-	zio_taskq_dispatch(zio, ZIO_TASKQ_INTERRUPT, B_FALSE);
+	zio_taskq_dispatch((zio_t *)zio, ZIO_TASKQ_INTERRUPT, B_FALSE);
 }
 
 void
@@ -1601,7 +1601,7 @@ zio_delay_interrupt(zio_t *zio)
 				 * OpenZFS's timeout_generic().
 				 */
 				tid = taskq_dispatch_delay(system_taskq,
-				    (task_func_t *)zio_interrupt,
+				    zio_interrupt,
 				    zio, TQ_NOSLEEP, expire_at_tick);
 				if (tid == TASKQID_INVALID) {
 					/*
@@ -1643,8 +1643,9 @@ static zio_pipe_stage_t *zio_pipeline[];
  * it is externally visible.
  */
 void
-zio_execute(zio_t *zio)
+zio_execute(void *_zio)
 {
+	zio_t *zio = _zio;
 	fstrans_cookie_t cookie;
 
 	cookie = spl_fstrans_mark();
@@ -1804,8 +1805,9 @@ zio_nowait(zio_t *zio)
  */
 
 static void
-zio_reexecute(zio_t *pio)
+zio_reexecute(void *_pio)
 {
+	zio_t *pio = _pio;
 	zio_t *cio, *cio_next;
 	int c, w;
 	zio_link_t *zl = NULL;
@@ -3974,7 +3976,7 @@ zio_done(zio_t *zio)
 			ASSERT(taskq_empty_ent(&zio->io_tqent));
 			spa_taskq_dispatch_ent(zio->io_spa,
 			    ZIO_TYPE_CLAIM, ZIO_TASKQ_ISSUE,
-			    (task_func_t *)zio_reexecute, zio, 0,
+			    zio_reexecute, zio, 0,
 			    &zio->io_tqent);
 		}
 		return (ZIO_PIPELINE_STOP);
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
index 254760220..01bcfd4d3 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -596,8 +596,10 @@ zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap)
  * after a system failure
  */
 static int
-zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap)
+zvol_replay_write(void *_zv, char *_lr, boolean_t byteswap)
 {
+	zvol_state_t *zv = _zv;
+	lr_write_t *lr = (lr_write_t *)_lr;
 	objset_t *os = zv->zv_objset;
 	char *data = (char *)(lr + 1);	/* data follows lr_write_t */
 	uint64_t off = lr->lr_offset;
@@ -622,7 +624,7 @@ zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap)
 }
 
 static int
-zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap)
+zvol_replay_err(void *zv, char *lr, boolean_t byteswap)
 {
 	return (SET_ERROR(ENOTSUP));
 }
@@ -632,19 +634,19 @@ zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap)
  * Only TX_WRITE and TX_TRUNCATE are needed for zvol.
  */
 zil_replay_func_t zvol_replay_vector[TX_MAX_TYPE] = {
-	(zil_replay_func_t)zvol_replay_err,	/* no such transaction type */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_CREATE */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_MKDIR */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_MKXATTR */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_SYMLINK */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_REMOVE */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_RMDIR */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_LINK */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_RENAME */
-	(zil_replay_func_t)zvol_replay_write,	/* TX_WRITE */
-	(zil_replay_func_t)zvol_replay_truncate, /* TX_TRUNCATE */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_SETATTR */
-	(zil_replay_func_t)zvol_replay_err,	/* TX_ACL */
+	zvol_replay_err,	/* no such transaction type */
+	zvol_replay_err,	/* TX_CREATE */
+	zvol_replay_err,	/* TX_MKDIR */
+	zvol_replay_err,	/* TX_MKXATTR */
+	zvol_replay_err,	/* TX_SYMLINK */
+	zvol_replay_err,	/* TX_REMOVE */
+	zvol_replay_err,	/* TX_RMDIR */
+	zvol_replay_err,	/* TX_LINK */
+	zvol_replay_err,	/* TX_RENAME */
+	zvol_replay_write,	/* TX_WRITE */
+	zvol_replay_err,	/* TX_TRUNCATE */
+	zvol_replay_err,	/* TX_SETATTR */
+	zvol_replay_err,	/* TX_ACL */
 };
 
 /*