Print this page
5056 ZFS deadlock on db_mtx and dn_holds
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/fs/zfs/dsl_deadlist.c
+++ new/usr/src/uts/common/fs/zfs/dsl_deadlist.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
|
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright (c) 2012 by Delphix. All rights reserved.
24 + * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
24 25 */
25 26
26 27 #include <sys/dsl_dataset.h>
27 28 #include <sys/dmu.h>
28 29 #include <sys/refcount.h>
29 30 #include <sys/zap.h>
30 31 #include <sys/zfs_context.h>
31 32 #include <sys/dsl_pool.h>
32 33
33 34 /*
34 35 * Deadlist concurrency:
35 36 *
36 37 * Deadlists can only be modified from the syncing thread.
37 38 *
38 39 * Except for dsl_deadlist_insert(), it can only be modified with the
39 40 * dp_config_rwlock held with RW_WRITER.
40 41 *
41 42 * The accessors (dsl_deadlist_space() and dsl_deadlist_space_range()) can
42 43 * be called concurrently, from open context, with the dl_config_rwlock held
43 44 * with RW_READER.
44 45 *
45 46 * Therefore, we only need to provide locking between dsl_deadlist_insert() and
46 47 * the accessors, protecting:
47 48 * dl_phys->dl_used,comp,uncomp
48 49 * and protecting the dl_tree from being loaded.
49 50 * The locking is provided by dl_lock. Note that locking on the bpobj_t
50 51 * provides its own locking, and dl_oldfmt is immutable.
51 52 */
52 53
53 54 static int
54 55 dsl_deadlist_compare(const void *arg1, const void *arg2)
55 56 {
56 57 const dsl_deadlist_entry_t *dle1 = arg1;
57 58 const dsl_deadlist_entry_t *dle2 = arg2;
58 59
59 60 if (dle1->dle_mintxg < dle2->dle_mintxg)
60 61 return (-1);
61 62 else if (dle1->dle_mintxg > dle2->dle_mintxg)
62 63 return (+1);
63 64 else
64 65 return (0);
65 66 }
66 67
67 68 static void
68 69 dsl_deadlist_load_tree(dsl_deadlist_t *dl)
69 70 {
70 71 zap_cursor_t zc;
71 72 zap_attribute_t za;
72 73
73 74 ASSERT(!dl->dl_oldfmt);
74 75 if (dl->dl_havetree)
75 76 return;
76 77
77 78 avl_create(&dl->dl_tree, dsl_deadlist_compare,
78 79 sizeof (dsl_deadlist_entry_t),
79 80 offsetof(dsl_deadlist_entry_t, dle_node));
80 81 for (zap_cursor_init(&zc, dl->dl_os, dl->dl_object);
81 82 zap_cursor_retrieve(&zc, &za) == 0;
82 83 zap_cursor_advance(&zc)) {
83 84 dsl_deadlist_entry_t *dle = kmem_alloc(sizeof (*dle), KM_SLEEP);
84 85 dle->dle_mintxg = strtonum(za.za_name, NULL);
85 86 VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os,
86 87 za.za_first_integer));
87 88 avl_add(&dl->dl_tree, dle);
88 89 }
89 90 zap_cursor_fini(&zc);
90 91 dl->dl_havetree = B_TRUE;
91 92 }
92 93
93 94 void
94 95 dsl_deadlist_open(dsl_deadlist_t *dl, objset_t *os, uint64_t object)
95 96 {
96 97 dmu_object_info_t doi;
97 98
98 99 mutex_init(&dl->dl_lock, NULL, MUTEX_DEFAULT, NULL);
99 100 dl->dl_os = os;
100 101 dl->dl_object = object;
101 102 VERIFY3U(0, ==, dmu_bonus_hold(os, object, dl, &dl->dl_dbuf));
102 103 dmu_object_info_from_db(dl->dl_dbuf, &doi);
103 104 if (doi.doi_type == DMU_OT_BPOBJ) {
104 105 dmu_buf_rele(dl->dl_dbuf, dl);
105 106 dl->dl_dbuf = NULL;
106 107 dl->dl_oldfmt = B_TRUE;
107 108 VERIFY3U(0, ==, bpobj_open(&dl->dl_bpobj, os, object));
108 109 return;
109 110 }
110 111
111 112 dl->dl_oldfmt = B_FALSE;
|
↓ open down ↓ |
78 lines elided |
↑ open up ↑ |
112 113 dl->dl_phys = dl->dl_dbuf->db_data;
113 114 dl->dl_havetree = B_FALSE;
114 115 }
115 116
116 117 void
117 118 dsl_deadlist_close(dsl_deadlist_t *dl)
118 119 {
119 120 void *cookie = NULL;
120 121 dsl_deadlist_entry_t *dle;
121 122
123 + dl->dl_os = NULL;
124 +
122 125 if (dl->dl_oldfmt) {
123 126 dl->dl_oldfmt = B_FALSE;
124 127 bpobj_close(&dl->dl_bpobj);
125 128 return;
126 129 }
127 130
128 131 if (dl->dl_havetree) {
129 132 while ((dle = avl_destroy_nodes(&dl->dl_tree, &cookie))
130 133 != NULL) {
131 134 bpobj_close(&dle->dle_bpobj);
132 135 kmem_free(dle, sizeof (*dle));
133 136 }
134 137 avl_destroy(&dl->dl_tree);
135 138 }
136 139 dmu_buf_rele(dl->dl_dbuf, dl);
137 140 mutex_destroy(&dl->dl_lock);
138 141 dl->dl_dbuf = NULL;
139 142 dl->dl_phys = NULL;
140 143 }
141 144
142 145 uint64_t
143 146 dsl_deadlist_alloc(objset_t *os, dmu_tx_t *tx)
144 147 {
145 148 if (spa_version(dmu_objset_spa(os)) < SPA_VERSION_DEADLISTS)
146 149 return (bpobj_alloc(os, SPA_OLD_MAXBLOCKSIZE, tx));
147 150 return (zap_create(os, DMU_OT_DEADLIST, DMU_OT_DEADLIST_HDR,
148 151 sizeof (dsl_deadlist_phys_t), tx));
149 152 }
150 153
151 154 void
152 155 dsl_deadlist_free(objset_t *os, uint64_t dlobj, dmu_tx_t *tx)
153 156 {
154 157 dmu_object_info_t doi;
155 158 zap_cursor_t zc;
156 159 zap_attribute_t za;
157 160
158 161 VERIFY3U(0, ==, dmu_object_info(os, dlobj, &doi));
159 162 if (doi.doi_type == DMU_OT_BPOBJ) {
160 163 bpobj_free(os, dlobj, tx);
161 164 return;
162 165 }
163 166
164 167 for (zap_cursor_init(&zc, os, dlobj);
165 168 zap_cursor_retrieve(&zc, &za) == 0;
166 169 zap_cursor_advance(&zc)) {
167 170 uint64_t obj = za.za_first_integer;
168 171 if (obj == dmu_objset_pool(os)->dp_empty_bpobj)
169 172 bpobj_decr_empty(os, tx);
170 173 else
171 174 bpobj_free(os, obj, tx);
172 175 }
173 176 zap_cursor_fini(&zc);
174 177 VERIFY3U(0, ==, dmu_object_free(os, dlobj, tx));
175 178 }
176 179
177 180 static void
178 181 dle_enqueue(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle,
179 182 const blkptr_t *bp, dmu_tx_t *tx)
180 183 {
181 184 if (dle->dle_bpobj.bpo_object ==
182 185 dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) {
183 186 uint64_t obj = bpobj_alloc(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx);
184 187 bpobj_close(&dle->dle_bpobj);
185 188 bpobj_decr_empty(dl->dl_os, tx);
186 189 VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj));
187 190 VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object,
188 191 dle->dle_mintxg, obj, tx));
189 192 }
190 193 bpobj_enqueue(&dle->dle_bpobj, bp, tx);
191 194 }
192 195
193 196 static void
194 197 dle_enqueue_subobj(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle,
195 198 uint64_t obj, dmu_tx_t *tx)
196 199 {
197 200 if (dle->dle_bpobj.bpo_object !=
198 201 dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) {
199 202 bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx);
200 203 } else {
201 204 bpobj_close(&dle->dle_bpobj);
202 205 bpobj_decr_empty(dl->dl_os, tx);
203 206 VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj));
204 207 VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object,
205 208 dle->dle_mintxg, obj, tx));
206 209 }
207 210 }
208 211
209 212 void
210 213 dsl_deadlist_insert(dsl_deadlist_t *dl, const blkptr_t *bp, dmu_tx_t *tx)
211 214 {
212 215 dsl_deadlist_entry_t dle_tofind;
213 216 dsl_deadlist_entry_t *dle;
214 217 avl_index_t where;
215 218
216 219 if (dl->dl_oldfmt) {
217 220 bpobj_enqueue(&dl->dl_bpobj, bp, tx);
218 221 return;
219 222 }
220 223
221 224 dsl_deadlist_load_tree(dl);
222 225
223 226 dmu_buf_will_dirty(dl->dl_dbuf, tx);
224 227 mutex_enter(&dl->dl_lock);
225 228 dl->dl_phys->dl_used +=
226 229 bp_get_dsize_sync(dmu_objset_spa(dl->dl_os), bp);
227 230 dl->dl_phys->dl_comp += BP_GET_PSIZE(bp);
228 231 dl->dl_phys->dl_uncomp += BP_GET_UCSIZE(bp);
229 232 mutex_exit(&dl->dl_lock);
230 233
231 234 dle_tofind.dle_mintxg = bp->blk_birth;
232 235 dle = avl_find(&dl->dl_tree, &dle_tofind, &where);
233 236 if (dle == NULL)
234 237 dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE);
235 238 else
236 239 dle = AVL_PREV(&dl->dl_tree, dle);
237 240 dle_enqueue(dl, dle, bp, tx);
238 241 }
239 242
240 243 /*
241 244 * Insert new key in deadlist, which must be > all current entries.
242 245 * mintxg is not inclusive.
243 246 */
244 247 void
245 248 dsl_deadlist_add_key(dsl_deadlist_t *dl, uint64_t mintxg, dmu_tx_t *tx)
246 249 {
247 250 uint64_t obj;
248 251 dsl_deadlist_entry_t *dle;
249 252
250 253 if (dl->dl_oldfmt)
251 254 return;
252 255
253 256 dsl_deadlist_load_tree(dl);
254 257
255 258 dle = kmem_alloc(sizeof (*dle), KM_SLEEP);
256 259 dle->dle_mintxg = mintxg;
257 260 obj = bpobj_alloc_empty(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx);
258 261 VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj));
259 262 avl_add(&dl->dl_tree, dle);
260 263
261 264 VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, dl->dl_object,
262 265 mintxg, obj, tx));
263 266 }
264 267
265 268 /*
266 269 * Remove this key, merging its entries into the previous key.
267 270 */
268 271 void
269 272 dsl_deadlist_remove_key(dsl_deadlist_t *dl, uint64_t mintxg, dmu_tx_t *tx)
270 273 {
271 274 dsl_deadlist_entry_t dle_tofind;
272 275 dsl_deadlist_entry_t *dle, *dle_prev;
273 276
274 277 if (dl->dl_oldfmt)
275 278 return;
276 279
277 280 dsl_deadlist_load_tree(dl);
278 281
279 282 dle_tofind.dle_mintxg = mintxg;
280 283 dle = avl_find(&dl->dl_tree, &dle_tofind, NULL);
281 284 dle_prev = AVL_PREV(&dl->dl_tree, dle);
282 285
283 286 dle_enqueue_subobj(dl, dle_prev, dle->dle_bpobj.bpo_object, tx);
284 287
285 288 avl_remove(&dl->dl_tree, dle);
286 289 bpobj_close(&dle->dle_bpobj);
287 290 kmem_free(dle, sizeof (*dle));
288 291
289 292 VERIFY3U(0, ==, zap_remove_int(dl->dl_os, dl->dl_object, mintxg, tx));
290 293 }
291 294
292 295 /*
293 296 * Walk ds's snapshots to regenerate generate ZAP & AVL.
294 297 */
295 298 static void
296 299 dsl_deadlist_regenerate(objset_t *os, uint64_t dlobj,
297 300 uint64_t mrs_obj, dmu_tx_t *tx)
298 301 {
299 302 dsl_deadlist_t dl;
300 303 dsl_pool_t *dp = dmu_objset_pool(os);
301 304
302 305 dsl_deadlist_open(&dl, os, dlobj);
303 306 if (dl.dl_oldfmt) {
304 307 dsl_deadlist_close(&dl);
305 308 return;
306 309 }
307 310
308 311 while (mrs_obj != 0) {
309 312 dsl_dataset_t *ds;
310 313 VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, mrs_obj, FTAG, &ds));
311 314 dsl_deadlist_add_key(&dl,
312 315 dsl_dataset_phys(ds)->ds_prev_snap_txg, tx);
313 316 mrs_obj = dsl_dataset_phys(ds)->ds_prev_snap_obj;
314 317 dsl_dataset_rele(ds, FTAG);
315 318 }
316 319 dsl_deadlist_close(&dl);
317 320 }
318 321
319 322 uint64_t
320 323 dsl_deadlist_clone(dsl_deadlist_t *dl, uint64_t maxtxg,
321 324 uint64_t mrs_obj, dmu_tx_t *tx)
322 325 {
323 326 dsl_deadlist_entry_t *dle;
324 327 uint64_t newobj;
325 328
326 329 newobj = dsl_deadlist_alloc(dl->dl_os, tx);
327 330
328 331 if (dl->dl_oldfmt) {
329 332 dsl_deadlist_regenerate(dl->dl_os, newobj, mrs_obj, tx);
330 333 return (newobj);
331 334 }
332 335
333 336 dsl_deadlist_load_tree(dl);
334 337
335 338 for (dle = avl_first(&dl->dl_tree); dle;
336 339 dle = AVL_NEXT(&dl->dl_tree, dle)) {
337 340 uint64_t obj;
338 341
339 342 if (dle->dle_mintxg >= maxtxg)
340 343 break;
341 344
342 345 obj = bpobj_alloc_empty(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx);
343 346 VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, newobj,
344 347 dle->dle_mintxg, obj, tx));
345 348 }
346 349 return (newobj);
347 350 }
348 351
349 352 void
350 353 dsl_deadlist_space(dsl_deadlist_t *dl,
351 354 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp)
352 355 {
353 356 if (dl->dl_oldfmt) {
354 357 VERIFY3U(0, ==, bpobj_space(&dl->dl_bpobj,
355 358 usedp, compp, uncompp));
356 359 return;
357 360 }
358 361
359 362 mutex_enter(&dl->dl_lock);
360 363 *usedp = dl->dl_phys->dl_used;
361 364 *compp = dl->dl_phys->dl_comp;
362 365 *uncompp = dl->dl_phys->dl_uncomp;
363 366 mutex_exit(&dl->dl_lock);
364 367 }
365 368
366 369 /*
367 370 * return space used in the range (mintxg, maxtxg].
368 371 * Includes maxtxg, does not include mintxg.
369 372 * mintxg and maxtxg must both be keys in the deadlist (unless maxtxg is
370 373 * larger than any bp in the deadlist (eg. UINT64_MAX)).
371 374 */
372 375 void
373 376 dsl_deadlist_space_range(dsl_deadlist_t *dl, uint64_t mintxg, uint64_t maxtxg,
374 377 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp)
375 378 {
376 379 dsl_deadlist_entry_t *dle;
377 380 dsl_deadlist_entry_t dle_tofind;
378 381 avl_index_t where;
379 382
380 383 if (dl->dl_oldfmt) {
381 384 VERIFY3U(0, ==, bpobj_space_range(&dl->dl_bpobj,
382 385 mintxg, maxtxg, usedp, compp, uncompp));
383 386 return;
384 387 }
385 388
386 389 *usedp = *compp = *uncompp = 0;
387 390
388 391 mutex_enter(&dl->dl_lock);
389 392 dsl_deadlist_load_tree(dl);
390 393 dle_tofind.dle_mintxg = mintxg;
391 394 dle = avl_find(&dl->dl_tree, &dle_tofind, &where);
392 395 /*
393 396 * If we don't find this mintxg, there shouldn't be anything
394 397 * after it either.
395 398 */
396 399 ASSERT(dle != NULL ||
397 400 avl_nearest(&dl->dl_tree, where, AVL_AFTER) == NULL);
398 401
399 402 for (; dle && dle->dle_mintxg < maxtxg;
400 403 dle = AVL_NEXT(&dl->dl_tree, dle)) {
401 404 uint64_t used, comp, uncomp;
402 405
403 406 VERIFY3U(0, ==, bpobj_space(&dle->dle_bpobj,
404 407 &used, &comp, &uncomp));
405 408
406 409 *usedp += used;
407 410 *compp += comp;
408 411 *uncompp += uncomp;
409 412 }
410 413 mutex_exit(&dl->dl_lock);
411 414 }
412 415
413 416 static void
414 417 dsl_deadlist_insert_bpobj(dsl_deadlist_t *dl, uint64_t obj, uint64_t birth,
415 418 dmu_tx_t *tx)
416 419 {
417 420 dsl_deadlist_entry_t dle_tofind;
418 421 dsl_deadlist_entry_t *dle;
419 422 avl_index_t where;
420 423 uint64_t used, comp, uncomp;
421 424 bpobj_t bpo;
422 425
423 426 VERIFY3U(0, ==, bpobj_open(&bpo, dl->dl_os, obj));
424 427 VERIFY3U(0, ==, bpobj_space(&bpo, &used, &comp, &uncomp));
425 428 bpobj_close(&bpo);
426 429
427 430 dsl_deadlist_load_tree(dl);
428 431
429 432 dmu_buf_will_dirty(dl->dl_dbuf, tx);
430 433 mutex_enter(&dl->dl_lock);
431 434 dl->dl_phys->dl_used += used;
432 435 dl->dl_phys->dl_comp += comp;
433 436 dl->dl_phys->dl_uncomp += uncomp;
434 437 mutex_exit(&dl->dl_lock);
435 438
436 439 dle_tofind.dle_mintxg = birth;
437 440 dle = avl_find(&dl->dl_tree, &dle_tofind, &where);
438 441 if (dle == NULL)
439 442 dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE);
440 443 dle_enqueue_subobj(dl, dle, obj, tx);
441 444 }
442 445
443 446 static int
444 447 dsl_deadlist_insert_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
445 448 {
446 449 dsl_deadlist_t *dl = arg;
447 450 dsl_deadlist_insert(dl, bp, tx);
448 451 return (0);
449 452 }
450 453
451 454 /*
452 455 * Merge the deadlist pointed to by 'obj' into dl. obj will be left as
453 456 * an empty deadlist.
454 457 */
455 458 void
456 459 dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, dmu_tx_t *tx)
457 460 {
458 461 zap_cursor_t zc;
459 462 zap_attribute_t za;
460 463 dmu_buf_t *bonus;
461 464 dsl_deadlist_phys_t *dlp;
462 465 dmu_object_info_t doi;
463 466
464 467 VERIFY3U(0, ==, dmu_object_info(dl->dl_os, obj, &doi));
465 468 if (doi.doi_type == DMU_OT_BPOBJ) {
466 469 bpobj_t bpo;
467 470 VERIFY3U(0, ==, bpobj_open(&bpo, dl->dl_os, obj));
468 471 VERIFY3U(0, ==, bpobj_iterate(&bpo,
469 472 dsl_deadlist_insert_cb, dl, tx));
470 473 bpobj_close(&bpo);
471 474 return;
472 475 }
473 476
474 477 for (zap_cursor_init(&zc, dl->dl_os, obj);
475 478 zap_cursor_retrieve(&zc, &za) == 0;
476 479 zap_cursor_advance(&zc)) {
477 480 uint64_t mintxg = strtonum(za.za_name, NULL);
478 481 dsl_deadlist_insert_bpobj(dl, za.za_first_integer, mintxg, tx);
479 482 VERIFY3U(0, ==, zap_remove_int(dl->dl_os, obj, mintxg, tx));
480 483 }
481 484 zap_cursor_fini(&zc);
482 485
483 486 VERIFY3U(0, ==, dmu_bonus_hold(dl->dl_os, obj, FTAG, &bonus));
484 487 dlp = bonus->db_data;
485 488 dmu_buf_will_dirty(bonus, tx);
486 489 bzero(dlp, sizeof (*dlp));
487 490 dmu_buf_rele(bonus, FTAG);
488 491 }
489 492
490 493 /*
491 494 * Remove entries on dl that are >= mintxg, and put them on the bpobj.
492 495 */
493 496 void
494 497 dsl_deadlist_move_bpobj(dsl_deadlist_t *dl, bpobj_t *bpo, uint64_t mintxg,
495 498 dmu_tx_t *tx)
496 499 {
497 500 dsl_deadlist_entry_t dle_tofind;
498 501 dsl_deadlist_entry_t *dle;
499 502 avl_index_t where;
500 503
501 504 ASSERT(!dl->dl_oldfmt);
502 505 dmu_buf_will_dirty(dl->dl_dbuf, tx);
503 506 dsl_deadlist_load_tree(dl);
504 507
505 508 dle_tofind.dle_mintxg = mintxg;
506 509 dle = avl_find(&dl->dl_tree, &dle_tofind, &where);
507 510 if (dle == NULL)
508 511 dle = avl_nearest(&dl->dl_tree, where, AVL_AFTER);
509 512 while (dle) {
510 513 uint64_t used, comp, uncomp;
511 514 dsl_deadlist_entry_t *dle_next;
512 515
513 516 bpobj_enqueue_subobj(bpo, dle->dle_bpobj.bpo_object, tx);
514 517
515 518 VERIFY3U(0, ==, bpobj_space(&dle->dle_bpobj,
516 519 &used, &comp, &uncomp));
517 520 mutex_enter(&dl->dl_lock);
518 521 ASSERT3U(dl->dl_phys->dl_used, >=, used);
519 522 ASSERT3U(dl->dl_phys->dl_comp, >=, comp);
520 523 ASSERT3U(dl->dl_phys->dl_uncomp, >=, uncomp);
521 524 dl->dl_phys->dl_used -= used;
522 525 dl->dl_phys->dl_comp -= comp;
523 526 dl->dl_phys->dl_uncomp -= uncomp;
524 527 mutex_exit(&dl->dl_lock);
525 528
526 529 VERIFY3U(0, ==, zap_remove_int(dl->dl_os, dl->dl_object,
527 530 dle->dle_mintxg, tx));
528 531
529 532 dle_next = AVL_NEXT(&dl->dl_tree, dle);
530 533 avl_remove(&dl->dl_tree, dle);
531 534 bpobj_close(&dle->dle_bpobj);
532 535 kmem_free(dle, sizeof (*dle));
533 536 dle = dle_next;
534 537 }
535 538 }
|
↓ open down ↓ |
404 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX