Deleted Added
full compact
arc.c (323667) arc.c (323752)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7300 unchanged lines hidden (view full) ---

7309 */
7310 ARCSTAT_BUMP(arcstat_l2_evict_lock_retry);
7311 mutex_exit(&dev->l2ad_mtx);
7312 mutex_enter(hash_lock);
7313 mutex_exit(hash_lock);
7314 goto top;
7315 }
7316
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7300 unchanged lines hidden (view full) ---

7309 */
7310 ARCSTAT_BUMP(arcstat_l2_evict_lock_retry);
7311 mutex_exit(&dev->l2ad_mtx);
7312 mutex_enter(hash_lock);
7313 mutex_exit(hash_lock);
7314 goto top;
7315 }
7316
7317 if (HDR_L2_WRITE_HEAD(hdr)) {
7318 /*
7319 * We hit a write head node. Leave it for
7320 * l2arc_write_done().
7321 */
7322 list_remove(buflist, hdr);
7323 mutex_exit(hash_lock);
7324 continue;
7325 }
7317 /*
7318 * A header can't be on this list if it doesn't have L2 header.
7319 */
7320 ASSERT(HDR_HAS_L2HDR(hdr));
7326
7321
7327 if (!all && HDR_HAS_L2HDR(hdr) &&
7328 (hdr->b_l2hdr.b_daddr >= taddr ||
7322 /* Ensure this header has finished being written. */
7323 ASSERT(!HDR_L2_WRITING(hdr));
7324 ASSERT(!HDR_L2_WRITE_HEAD(hdr));
7325
7326 if (!all && (hdr->b_l2hdr.b_daddr >= taddr ||
7329 hdr->b_l2hdr.b_daddr < dev->l2ad_hand)) {
7330 /*
7331 * We've evicted to the target address,
7332 * or the end of the device.
7333 */
7334 mutex_exit(hash_lock);
7335 break;
7336 }
7337
7327 hdr->b_l2hdr.b_daddr < dev->l2ad_hand)) {
7328 /*
7329 * We've evicted to the target address,
7330 * or the end of the device.
7331 */
7332 mutex_exit(hash_lock);
7333 break;
7334 }
7335
7338 ASSERT(HDR_HAS_L2HDR(hdr));
7339 if (!HDR_HAS_L1HDR(hdr)) {
7340 ASSERT(!HDR_L2_READING(hdr));
7341 /*
7342 * This doesn't exist in the ARC. Destroy.
7343 * arc_hdr_destroy() will call list_remove()
7344 * and decrement arcstat_l2_size.
7345 */
7346 arc_change_state(arc_anon, hdr, hash_lock);

--- 6 unchanged lines hidden (view full) ---

7353 * reads, since we may be about to write
7354 * over this location.
7355 */
7356 if (HDR_L2_READING(hdr)) {
7357 ARCSTAT_BUMP(arcstat_l2_evict_reading);
7358 arc_hdr_set_flags(hdr, ARC_FLAG_L2_EVICTED);
7359 }
7360
7336 if (!HDR_HAS_L1HDR(hdr)) {
7337 ASSERT(!HDR_L2_READING(hdr));
7338 /*
7339 * This doesn't exist in the ARC. Destroy.
7340 * arc_hdr_destroy() will call list_remove()
7341 * and decrement arcstat_l2_size.
7342 */
7343 arc_change_state(arc_anon, hdr, hash_lock);

--- 6 unchanged lines hidden (view full) ---

7350 * reads, since we may be about to write
7351 * over this location.
7352 */
7353 if (HDR_L2_READING(hdr)) {
7354 ARCSTAT_BUMP(arcstat_l2_evict_reading);
7355 arc_hdr_set_flags(hdr, ARC_FLAG_L2_EVICTED);
7356 }
7357
7361 /* Ensure this header has finished being written */
7362 ASSERT(!HDR_L2_WRITING(hdr));
7363
7364 arc_hdr_l2hdr_destroy(hdr);
7365 }
7366 mutex_exit(hash_lock);
7367 }
7368 mutex_exit(&dev->l2ad_mtx);
7369}
7370
7371/*

--- 487 unchanged lines hidden ---
7358 arc_hdr_l2hdr_destroy(hdr);
7359 }
7360 mutex_exit(hash_lock);
7361 }
7362 mutex_exit(&dev->l2ad_mtx);
7363}
7364
7365/*

--- 487 unchanged lines hidden ---