aboutsummaryrefslogtreecommitdiffstats
path: root/main/zfs-grsec/pax-rap-fixes.patch
blob: 462ef57e4884f221e172fe5288c52d2662624c40 (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
591
592
593
594
595
596
597
598
599
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 40524ed..a83b559 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -5541,7 +5541,7 @@ ztest_resume(spa_t *spa)
 	(void) zio_resume(spa);
 }
 
-static void *
+static void
 ztest_resume_thread(void *arg)
 {
 	spa_t *spa = arg;
@@ -5553,8 +5553,6 @@ ztest_resume_thread(void *arg)
 	}
 
 	thread_exit();
-
-	return (NULL);
 }
 
 #define	GRACE	300
@@ -5588,7 +5586,7 @@ ztest_execute(int test, ztest_info_t *zi, uint64_t id)
 		    (double)functime / NANOSEC, zi->zi_funcname);
 }
 
-static void *
+static void
 ztest_thread(void *arg)
 {
 	int rand;
@@ -5628,8 +5626,6 @@ ztest_thread(void *arg)
 	}
 
 	thread_exit();
-
-	return (NULL);
 }
 
 static void
@@ -5818,7 +5814,7 @@ ztest_run(ztest_shared_t *zs)
 	 * Create a thread to periodically resume suspended I/O.
 	 */
 	VERIFY3P((resume_thread = zk_thread_create(NULL, 0,
-	    (thread_func_t)ztest_resume_thread, spa, TS_RUN, NULL, 0, 0,
+	    ztest_resume_thread, spa, TS_RUN, NULL, 0, 0,
 	    PTHREAD_CREATE_JOINABLE)), !=, NULL);
 
 #if 0
@@ -5870,7 +5866,7 @@ ztest_run(ztest_shared_t *zs)
 			return;
 
 		VERIFY3P(thread = zk_thread_create(NULL, 0,
-		    (thread_func_t)ztest_thread,
+		    ztest_thread,
 		    (void *)(uintptr_t)t, TS_RUN, NULL, 0, 0,
 		    PTHREAD_CREATE_JOINABLE), !=, NULL);
 		tid[t] = thread->t_tid;
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 78e33e1..255b1a4 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -240,7 +240,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 4916d87..973dc73 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -513,7 +513,7 @@ 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_execute(void *zio);
 extern void zio_interrupt(zio_t *zio);
 
 extern zio_t *zio_walk_parents(zio_t *cio);
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 04fde6c..a9652dd 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -3416,7 +3416,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();
 	clock_t			growtime = 0;
@@ -3509,7 +3509,7 @@ arc_reclaim_thread(void)
 }
 
 static void
-arc_user_evicts_thread(void)
+arc_user_evicts_thread(void *_unused)
 {
 	fstrans_cookie_t	cookie = spl_fstrans_mark();
 	callb_cpr_t cpr;
@@ -6732,7 +6732,7 @@ l2arc_release_cdata_buf(arc_buf_hdr_t *hdr)
  * 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 483067c..68d2933 100644
--- a/module/zfs/dbuf.c
+++ b/module/zfs/dbuf.c
@@ -1583,7 +1583,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)
@@ -1605,6 +1604,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,
@@ -2240,13 +2245,20 @@ 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)
 {
 	VERIFY(refcount_add(&db->db_holds, tag) > 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,
@@ -2412,13 +2424,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/spa.c b/module/zfs/spa.c
index dde909e..34ff0dc 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -5646,8 +5646,9 @@ spa_async_autoexpand(spa_t *spa, vdev_t *vd)
 }
 
 static void
-spa_async_thread(spa_t *spa)
+spa_async_thread(void *_spa)
 {
+	spa_t *spa = _spa;
 	int tasks, i;
 
 	ASSERT(spa->spa_sync_on);
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index 1d5ee97..6469c8b 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -107,8 +107,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 *_dp);
+static void txg_quiesce_thread(void *_dp);
 
 int zfs_txg_timeout = 5;	/* max seconds worth of delta per txg */
 
@@ -406,8 +406,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);
@@ -455,7 +456,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);
 	}
 }
@@ -475,8 +476,9 @@ txg_wait_callbacks(dsl_pool_t *dp)
 }
 
 static void
-txg_sync_thread(dsl_pool_t *dp)
+txg_sync_thread(void *_dp)
 {
+	dsl_pool_t *dp = _dp;
 	spa_t *spa = dp->dp_spa;
 	tx_state_t *tx = &dp->dp_tx;
 	callb_cpr_t cpr;
@@ -584,8 +586,9 @@ txg_sync_thread(dsl_pool_t *dp)
 }
 
 static void
-txg_quiesce_thread(dsl_pool_t *dp)
+txg_quiesce_thread(void *_dp)
 {
+	dsl_pool_t *dp = _dp;
 	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 0ca1e03..66a2d96 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(zfs_sb_t *zsb, lr_t *lr, boolean_t byteswap)
+zfs_replay_error(void *zsb, char *lr, boolean_t byteswap)
 {
 	return (SET_ERROR(ENOTSUP));
 }
@@ -265,8 +265,10 @@ zfs_replay_swap_attrs(lr_attr_t *lrattr)
  * as option FUID information.
  */
 static int
-zfs_replay_create_acl(zfs_sb_t *zsb, lr_acl_create_t *lracl, boolean_t byteswap)
+zfs_replay_create_acl(void *_zsb, char *_lracl, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	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;
@@ -405,8 +407,10 @@ bail:
 }
 
 static int
-zfs_replay_create(zfs_sb_t *zsb, lr_create_t *lr, boolean_t byteswap)
+zfs_replay_create(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_create_t *lr = (lr_create_t *)_lr;
 	char *name = NULL;		/* location determined later */
 	char *link;			/* symlink content follows name */
 	znode_t *dzp;
@@ -530,8 +534,10 @@ out:
 }
 
 static int
-zfs_replay_remove(zfs_sb_t *zsb, lr_remove_t *lr, boolean_t byteswap)
+zfs_replay_remove(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_remove_t *lr = (lr_remove_t *)_lr;
 	char *name = (char *)(lr + 1);	/* name follows lr_remove_t */
 	znode_t *dzp;
 	int error;
@@ -563,8 +569,10 @@ zfs_replay_remove(zfs_sb_t *zsb, lr_remove_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_link(zfs_sb_t *zsb, lr_link_t *lr, boolean_t byteswap)
+zfs_replay_link(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_link_t *lr = (lr_link_t *)_lr;
 	char *name = (char *)(lr + 1);	/* name follows lr_link_t */
 	znode_t *dzp, *zp;
 	int error;
@@ -593,8 +601,10 @@ zfs_replay_link(zfs_sb_t *zsb, lr_link_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_rename(zfs_sb_t *zsb, lr_rename_t *lr, boolean_t byteswap)
+zfs_replay_rename(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	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;
@@ -624,8 +634,10 @@ zfs_replay_rename(zfs_sb_t *zsb, lr_rename_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_write(zfs_sb_t *zsb, lr_write_t *lr, boolean_t byteswap)
+zfs_replay_write(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_write_t *lr = (lr_write_t *)_lr;
 	char *data = (char *)(lr + 1);	/* data follows lr_write_t */
 	znode_t	*zp;
 	int error, written;
@@ -693,8 +705,10 @@ zfs_replay_write(zfs_sb_t *zsb, lr_write_t *lr, boolean_t byteswap)
  * the file is grown.
  */
 static int
-zfs_replay_write2(zfs_sb_t *zsb, lr_write_t *lr, boolean_t byteswap)
+zfs_replay_write2(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_write_t *lr = (lr_write_t *)_lr;
 	znode_t	*zp;
 	int error;
 	uint64_t end;
@@ -738,8 +752,10 @@ top:
 }
 
 static int
-zfs_replay_truncate(zfs_sb_t *zsb, lr_truncate_t *lr, boolean_t byteswap)
+zfs_replay_truncate(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_truncate_t *lr = (lr_truncate_t *)_lr;
 	znode_t *zp;
 	flock64_t fl;
 	int error;
@@ -765,8 +781,10 @@ zfs_replay_truncate(zfs_sb_t *zsb, lr_truncate_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_setattr(zfs_sb_t *zsb, lr_setattr_t *lr, boolean_t byteswap)
+zfs_replay_setattr(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_setattr_t *lr = (lr_setattr_t *)_lr;
 	znode_t *zp;
 	xvattr_t xva;
 	vattr_t *vap = &xva.xva_vattr;
@@ -817,8 +835,10 @@ zfs_replay_setattr(zfs_sb_t *zsb, lr_setattr_t *lr, boolean_t byteswap)
 }
 
 static int
-zfs_replay_acl_v0(zfs_sb_t *zsb, lr_acl_v0_t *lr, boolean_t byteswap)
+zfs_replay_acl_v0(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	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;
@@ -861,8 +881,10 @@ zfs_replay_acl_v0(zfs_sb_t *zsb, lr_acl_v0_t *lr, boolean_t byteswap)
  *
  */
 static int
-zfs_replay_acl(zfs_sb_t *zsb, lr_acl_t *lr, boolean_t byteswap)
+zfs_replay_acl(void *_zsb, char *_lr, boolean_t byteswap)
 {
+	zfs_sb_t *zsb = _zsb;
+	lr_acl_t *lr = (lr_acl_t *)_lr;
 	ace_t *ace = (ace_t *)(lr + 1);
 	vsecattr_t vsa;
 	znode_t *zp;
@@ -912,25 +934,25 @@ zfs_replay_acl(zfs_sb_t *zsb, 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 384a37f..76d02a4 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -919,6 +919,13 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
 }
 EXPORT_SYMBOL(zfs_write);
 
+static void
+iput_wrapper(void *_i)
+{
+	struct inode *i = _i;
+	iput(i);
+}
+
 void
 zfs_iput_async(struct inode *ip)
 {
@@ -929,7 +936,7 @@ zfs_iput_async(struct inode *ip)
 
 	if (atomic_read(&ip->i_count) == 1)
 		taskq_dispatch(dsl_pool_iput_taskq(dmu_objset_pool(os)),
-		    (task_func_t *)iput, ip, TQ_SLEEP);
+		    iput_wrapper, ip, TQ_SLEEP);
 	else
 		iput(ip);
 }
diff --git a/module/zfs/zil.c b/module/zfs/zil.c
index 289b23c..f909e99 100644
--- a/module/zfs/zil.c
+++ b/module/zfs/zil.c
@@ -1217,8 +1217,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;
@@ -1431,7 +1432,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 2bc88c5..df44e39 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -1345,7 +1345,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);
 }
 
@@ -1406,8 +1406,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();
@@ -1560,8 +1561,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;
 
@@ -3362,7 +3364,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 0bb68f9..9f4b11a 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -483,8 +483,10 @@ out:
  * 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;
@@ -509,7 +511,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));
 }
@@ -519,19 +521,19 @@ zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap)
  * Only TX_WRITE is 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_err,	/* 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 */
 };
 
 /*