Print this page
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>


2530          * it's in the hash table, and it should be legit since it's
2531          * not possible to evict it during the I/O.  The only possible
2532          * reason for it not to be found is if we were freed during the
2533          * read.
2534          */
2535         found = buf_hash_find(hdr->b_spa, &hdr->b_dva, hdr->b_birth,
2536             &hash_lock);
2537 
2538         ASSERT((found == NULL && HDR_FREED_IN_READ(hdr) && hash_lock == NULL) ||
2539             (found == hdr && DVA_EQUAL(&hdr->b_dva, BP_IDENTITY(zio->io_bp))) ||
2540             (found == hdr && HDR_L2_READING(hdr)));
2541 
2542         hdr->b_flags &= ~ARC_L2_EVICTED;
2543         if (l2arc_noprefetch && (hdr->b_flags & ARC_PREFETCH))
2544                 hdr->b_flags &= ~ARC_L2CACHE;
2545 
2546         /* byteswap if necessary */
2547         callback_list = hdr->b_acb;
2548         ASSERT(callback_list != NULL);
2549         if (BP_SHOULD_BYTESWAP(zio->io_bp) && zio->io_error == 0) {


2550                 arc_byteswap_func_t *func = BP_GET_LEVEL(zio->io_bp) > 0 ?
2551                     byteswap_uint64_array :
2552                     dmu_ot[BP_GET_TYPE(zio->io_bp)].ot_byteswap;
2553                 func(buf->b_data, hdr->b_size);
2554         }
2555 
2556         arc_cksum_compute(buf, B_FALSE);
2557 
2558         if (hash_lock && zio->io_error == 0 && hdr->b_state == arc_anon) {
2559                 /*
2560                  * Only call arc_access on anonymous buffers.  This is because
2561                  * if we've issued an I/O for an evicted buffer, we've already
2562                  * called arc_access (to prevent any simultaneous readers from
2563                  * getting confused).
2564                  */
2565                 arc_access(hdr, hash_lock);
2566         }
2567 
2568         /* create copies of the data buffer for the callers */
2569         abuf = buf;
2570         for (acb = callback_list; acb; acb = acb->acb_next) {
2571                 if (acb->acb_done) {
2572                         if (abuf == NULL)




2530          * it's in the hash table, and it should be legit since it's
2531          * not possible to evict it during the I/O.  The only possible
2532          * reason for it not to be found is if we were freed during the
2533          * read.
2534          */
2535         found = buf_hash_find(hdr->b_spa, &hdr->b_dva, hdr->b_birth,
2536             &hash_lock);
2537 
2538         ASSERT((found == NULL && HDR_FREED_IN_READ(hdr) && hash_lock == NULL) ||
2539             (found == hdr && DVA_EQUAL(&hdr->b_dva, BP_IDENTITY(zio->io_bp))) ||
2540             (found == hdr && HDR_L2_READING(hdr)));
2541 
2542         hdr->b_flags &= ~ARC_L2_EVICTED;
2543         if (l2arc_noprefetch && (hdr->b_flags & ARC_PREFETCH))
2544                 hdr->b_flags &= ~ARC_L2CACHE;
2545 
2546         /* byteswap if necessary */
2547         callback_list = hdr->b_acb;
2548         ASSERT(callback_list != NULL);
2549         if (BP_SHOULD_BYTESWAP(zio->io_bp) && zio->io_error == 0) {
2550                 dmu_object_byteswap_t bswap =
2551                     DMU_OT_BYTESWAP(BP_GET_TYPE(zio->io_bp));
2552                 arc_byteswap_func_t *func = BP_GET_LEVEL(zio->io_bp) > 0 ?
2553                     byteswap_uint64_array :
2554                     dmu_ot_byteswap[bswap].ob_func;
2555                 func(buf->b_data, hdr->b_size);
2556         }
2557 
2558         arc_cksum_compute(buf, B_FALSE);
2559 
2560         if (hash_lock && zio->io_error == 0 && hdr->b_state == arc_anon) {
2561                 /*
2562                  * Only call arc_access on anonymous buffers.  This is because
2563                  * if we've issued an I/O for an evicted buffer, we've already
2564                  * called arc_access (to prevent any simultaneous readers from
2565                  * getting confused).
2566                  */
2567                 arc_access(hdr, hash_lock);
2568         }
2569 
2570         /* create copies of the data buffer for the callers */
2571         abuf = buf;
2572         for (acb = callback_list; acb; acb = acb->acb_next) {
2573                 if (acb->acb_done) {
2574                         if (abuf == NULL)