|
Lines 6911-6917
top:
Link Here
|
| 6911 |
} |
6911 |
} |
| 6912 |
|
6912 |
|
| 6913 |
if (!all && HDR_HAS_L2HDR(hdr) && |
6913 |
if (!all && HDR_HAS_L2HDR(hdr) && |
| 6914 |
(hdr->b_l2hdr.b_daddr > taddr || |
6914 |
(hdr->b_l2hdr.b_daddr >= taddr || |
| 6915 |
hdr->b_l2hdr.b_daddr < dev->l2ad_hand)) { |
6915 |
hdr->b_l2hdr.b_daddr < dev->l2ad_hand)) { |
| 6916 |
/* |
6916 |
/* |
| 6917 |
* We've evicted to the target address, |
6917 |
* We've evicted to the target address, |
|
Lines 7045-7051
l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
Link Here
|
| 7045 |
continue; |
7045 |
continue; |
| 7046 |
} |
7046 |
} |
| 7047 |
|
7047 |
|
| 7048 |
if ((write_asize + HDR_GET_LSIZE(hdr)) > target_sz) { |
7048 |
/* |
|
|
7049 |
* We rely on the L1 portion of the header below, so |
| 7050 |
* it's invalid for this header to have been evicted out |
| 7051 |
* of the ghost cache, prior to being written out. The |
| 7052 |
* ARC_FLAG_L2_WRITING bit ensures this won't happen. |
| 7053 |
*/ |
| 7054 |
ASSERT(HDR_HAS_L1HDR(hdr)); |
| 7055 |
|
| 7056 |
ASSERT3U(HDR_GET_PSIZE(hdr), >, 0); |
| 7057 |
ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL); |
| 7058 |
ASSERT3U(arc_hdr_size(hdr), >, 0); |
| 7059 |
uint64_t size = arc_hdr_size(hdr); |
| 7060 |
uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, |
| 7061 |
size); |
| 7062 |
|
| 7063 |
if ((write_psize + asize) > target_sz) { |
| 7049 |
full = B_TRUE; |
7064 |
full = B_TRUE; |
| 7050 |
mutex_exit(hash_lock); |
7065 |
mutex_exit(hash_lock); |
| 7051 |
ARCSTAT_BUMP(arcstat_l2_write_full); |
7066 |
ARCSTAT_BUMP(arcstat_l2_write_full); |
|
Lines 7080-7100
l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
Link Here
|
| 7080 |
list_insert_head(&dev->l2ad_buflist, hdr); |
7095 |
list_insert_head(&dev->l2ad_buflist, hdr); |
| 7081 |
mutex_exit(&dev->l2ad_mtx); |
7096 |
mutex_exit(&dev->l2ad_mtx); |
| 7082 |
|
7097 |
|
| 7083 |
/* |
|
|
| 7084 |
* We rely on the L1 portion of the header below, so |
| 7085 |
* it's invalid for this header to have been evicted out |
| 7086 |
* of the ghost cache, prior to being written out. The |
| 7087 |
* ARC_FLAG_L2_WRITING bit ensures this won't happen. |
| 7088 |
*/ |
| 7089 |
ASSERT(HDR_HAS_L1HDR(hdr)); |
| 7090 |
|
| 7091 |
ASSERT3U(HDR_GET_PSIZE(hdr), >, 0); |
| 7092 |
ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL); |
| 7093 |
ASSERT3U(arc_hdr_size(hdr), >, 0); |
| 7094 |
uint64_t size = arc_hdr_size(hdr); |
| 7095 |
uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev, |
| 7096 |
size); |
| 7097 |
|
| 7098 |
(void) refcount_add_many(&dev->l2ad_alloc, size, hdr); |
7098 |
(void) refcount_add_many(&dev->l2ad_alloc, size, hdr); |
| 7099 |
|
7099 |
|
| 7100 |
/* |
7100 |
/* |
|
Lines 7156-7162
l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
Link Here
|
| 7156 |
return (0); |
7156 |
return (0); |
| 7157 |
} |
7157 |
} |
| 7158 |
|
7158 |
|
| 7159 |
ASSERT3U(write_asize, <=, target_sz); |
7159 |
ASSERT3U(write_psize, <=, target_sz); |
| 7160 |
ARCSTAT_BUMP(arcstat_l2_writes_sent); |
7160 |
ARCSTAT_BUMP(arcstat_l2_writes_sent); |
| 7161 |
ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); |
7161 |
ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); |
| 7162 |
ARCSTAT_INCR(arcstat_l2_size, write_sz); |
7162 |
ARCSTAT_INCR(arcstat_l2_size, write_sz); |