| 2641 | } |
| 2642 | |
| 2643 | boolean_t |
| 2644 | vdev_dtl_contains(vdev_t *vd, vdev_dtl_type_t t, uint64_t txg, uint64_t size) |
| 2645 | { |
| 2646 | range_tree_t *rt = vd->vdev_dtl[t]; |
| 2647 | boolean_t dirty = B_FALSE; |
| 2648 | |
| 2649 | ASSERT(t < DTL_TYPES); |
| 2650 | ASSERT(vd != vd->vdev_spa->spa_root_vdev); |
| 2651 | |
| 2652 | /* |
| 2653 | * While we are loading the pool, the DTLs have not been loaded yet. |
| 2654 | * This isn't a problem but it can result in devices being tried |
| 2655 | * which are known to not have the data. In which case, the import |
| 2656 | * is relying on the checksum to ensure that we get the right data. |
| 2657 | * Note that while importing we are only reading the MOS, which is |
| 2658 | * always checksummed. |
| 2659 | */ |
| 2660 | mutex_enter(&vd->vdev_dtl_lock); |
| 2661 | if (!range_tree_is_empty(rt)) |
| 2662 | dirty = range_tree_contains(rt, txg, size); |
| 2663 | mutex_exit(&vd->vdev_dtl_lock); |
| 2664 | |
| 2665 | return (dirty); |
| 2666 | } |
| 2667 | |
| 2668 | boolean_t |
| 2669 | vdev_dtl_empty(vdev_t *vd, vdev_dtl_type_t t) |
no test coverage detected