@@ -210,13 +210,6 @@ sa_cache_constructor(void *buf, void *unused, int kmflag)
210
210
{
211
211
sa_handle_t * hdl = buf ;
212
212
213
- hdl -> sa_dbu .dbu_evict_func = NULL ;
214
- hdl -> sa_bonus_tab = NULL ;
215
- hdl -> sa_spill_tab = NULL ;
216
- hdl -> sa_os = NULL ;
217
- hdl -> sa_userp = NULL ;
218
- hdl -> sa_bonus = NULL ;
219
- hdl -> sa_spill = NULL ;
220
213
mutex_init (& hdl -> sa_lock , NULL , MUTEX_DEFAULT , NULL );
221
214
return (0 );
222
215
}
@@ -226,7 +219,6 @@ static void
226
219
sa_cache_destructor (void * buf , void * unused )
227
220
{
228
221
sa_handle_t * hdl = buf ;
229
- hdl -> sa_dbu .dbu_evict_func = NULL ;
230
222
mutex_destroy (& hdl -> sa_lock );
231
223
}
232
224
@@ -1369,14 +1361,11 @@ sa_handle_destroy(sa_handle_t *hdl)
1369
1361
mutex_enter (& hdl -> sa_lock );
1370
1362
(void ) dmu_buf_remove_user (db , & hdl -> sa_dbu );
1371
1363
1372
- if (hdl -> sa_bonus_tab ) {
1364
+ if (hdl -> sa_bonus_tab )
1373
1365
sa_idx_tab_rele (hdl -> sa_os , hdl -> sa_bonus_tab );
1374
- hdl -> sa_bonus_tab = NULL ;
1375
- }
1376
- if (hdl -> sa_spill_tab ) {
1366
+
1367
+ if (hdl -> sa_spill_tab )
1377
1368
sa_idx_tab_rele (hdl -> sa_os , hdl -> sa_spill_tab );
1378
- hdl -> sa_spill_tab = NULL ;
1379
- }
1380
1369
1381
1370
dmu_buf_rele (hdl -> sa_bonus , NULL );
1382
1371
@@ -1410,10 +1399,13 @@ sa_handle_get_from_db(objset_t *os, dmu_buf_t *db, void *userp,
1410
1399
sa_handle_t * winner = NULL ;
1411
1400
1412
1401
handle = kmem_cache_alloc (sa_cache , KM_SLEEP );
1402
+ handle -> sa_dbu .dbu_evict_func = NULL ;
1413
1403
handle -> sa_userp = userp ;
1414
1404
handle -> sa_bonus = db ;
1415
1405
handle -> sa_os = os ;
1416
1406
handle -> sa_spill = NULL ;
1407
+ handle -> sa_bonus_tab = NULL ;
1408
+ handle -> sa_spill_tab = NULL ;
1417
1409
1418
1410
error = sa_build_index (handle , SA_BONUS );
1419
1411
0 commit comments