| 342 | } |
| 343 | |
| 344 | void |
| 345 | free_buffer_head(struct buffer_head * bh) |
| 346 | { |
| 347 | if (bh) { |
| 348 | if (bh->b_mdl) { |
| 349 | |
| 350 | DEBUG(DL_BH, ("bh=%p mdl=%p (Flags:%xh VA:%p) released.\n", bh, bh->b_mdl, |
| 351 | bh->b_mdl->MdlFlags, bh->b_mdl->MappedSystemVa)); |
| 352 | if (IsFlagOn(bh->b_mdl->MdlFlags, MDL_MAPPED_TO_SYSTEM_VA)) { |
| 353 | MmUnmapLockedPages(bh->b_mdl->MappedSystemVa, bh->b_mdl); |
| 354 | } |
| 355 | Ext2DestroyMdl(bh->b_mdl); |
| 356 | } |
| 357 | if (bh->b_bcb) { |
| 358 | CcUnpinDataForThread(bh->b_bcb, (ERESOURCE_THREAD)bh | 0x3); |
| 359 | } |
| 360 | |
| 361 | DEBUG(DL_BH, ("bh=%p freed.\n", bh)); |
| 362 | DEC_MEM_COUNT(PS_BUFF_HEAD, bh, sizeof(struct buffer_head)); |
| 363 | kmem_cache_free(g_jbh.bh_cache, bh); |
| 364 | atomic_dec(&g_jbh.bh_count); |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | // |
| 369 | // Red-black tree insert routine. |
no test coverage detected