|
Lines 211-216
sa_cache_constructor(void *buf, void *unused, int kmflag)
Link Here
|
| 211 |
{ |
211 |
{ |
| 212 |
sa_handle_t *hdl = buf; |
212 |
sa_handle_t *hdl = buf; |
| 213 |
|
213 |
|
|
|
214 |
hdl->sa_dbu.dbu_evict_func = NULL; |
| 214 |
mutex_init(&hdl->sa_lock, NULL, MUTEX_DEFAULT, NULL); |
215 |
mutex_init(&hdl->sa_lock, NULL, MUTEX_DEFAULT, NULL); |
| 215 |
return (0); |
216 |
return (0); |
| 216 |
} |
217 |
} |
|
Lines 220-226
static void
Link Here
|
| 220 |
sa_cache_destructor(void *buf, void *unused) |
221 |
sa_cache_destructor(void *buf, void *unused) |
| 221 |
{ |
222 |
{ |
| 222 |
sa_handle_t *hdl = buf; |
223 |
sa_handle_t *hdl = buf; |
| 223 |
hdl->sa_dbu.dbu_evict_func = NULL; |
224 |
|
|
|
225 |
ASSERT3P(hdl->sa_dbu.dbu_evict_func, ==, NULL); |
| 224 |
mutex_destroy(&hdl->sa_lock); |
226 |
mutex_destroy(&hdl->sa_lock); |
| 225 |
} |
227 |
} |
| 226 |
|
228 |
|
|
Lines 1360-1365
sa_handle_destroy(sa_handle_t *hdl)
Link Here
|
| 1360 |
dmu_buf_rele((dmu_buf_t *)hdl->sa_spill, NULL); |
1362 |
dmu_buf_rele((dmu_buf_t *)hdl->sa_spill, NULL); |
| 1361 |
mutex_exit(&hdl->sa_lock); |
1363 |
mutex_exit(&hdl->sa_lock); |
| 1362 |
|
1364 |
|
|
|
1365 |
hdl->sa_dbu.dbu_evict_func = NULL; |
| 1363 |
kmem_cache_free(sa_cache, hdl); |
1366 |
kmem_cache_free(sa_cache, hdl); |
| 1364 |
} |
1367 |
} |
| 1365 |
|
1368 |
|
|
Lines 1401-1406
sa_handle_get_from_db(objset_t *os, dmu_buf_t *db, void *userp,
Link Here
|
| 1401 |
} |
1404 |
} |
| 1402 |
|
1405 |
|
| 1403 |
if (winner != NULL) { |
1406 |
if (winner != NULL) { |
|
|
1407 |
handle->sa_dbu.dbu_evict_func = NULL; |
| 1404 |
kmem_cache_free(sa_cache, handle); |
1408 |
kmem_cache_free(sa_cache, handle); |
| 1405 |
handle = winner; |
1409 |
handle = winner; |
| 1406 |
} |
1410 |
} |