• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/openzfs/module/zfs/

Lines Matching refs:ve

137 vdev_cache_evict(vdev_cache_t *vc, vdev_cache_entry_t *ve)
140 ASSERT3P(ve->ve_fill_io, ==, NULL);
141 ASSERT3P(ve->ve_abd, !=, NULL);
143 avl_remove(&vc->vc_lastused_tree, ve);
144 avl_remove(&vc->vc_offset_tree, ve);
145 abd_free(ve->ve_abd);
146 kmem_free(ve, sizeof (vdev_cache_entry_t));
159 vdev_cache_entry_t *ve;
172 ve = avl_first(&vc->vc_lastused_tree);
173 if (ve->ve_fill_io != NULL)
175 ASSERT3U(ve->ve_hits, !=, 0);
176 vdev_cache_evict(vc, ve);
179 ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_SLEEP);
180 ve->ve_offset = offset;
181 ve->ve_lastused = ddi_get_lbolt();
182 ve->ve_abd = abd_alloc_for_io(VCBS, B_TRUE);
184 avl_add(&vc->vc_offset_tree, ve);
185 avl_add(&vc->vc_lastused_tree, ve);
187 return (ve);
191 vdev_cache_hit(vdev_cache_t *vc, vdev_cache_entry_t *ve, zio_t *zio)
196 ASSERT3P(ve->ve_fill_io, ==, NULL);
198 if (ve->ve_lastused != ddi_get_lbolt()) {
199 avl_remove(&vc->vc_lastused_tree, ve);
200 ve->ve_lastused = ddi_get_lbolt();
201 avl_add(&vc->vc_lastused_tree, ve);
204 ve->ve_hits++;
205 abd_copy_off(zio->io_abd, ve->ve_abd, 0, cache_phase, zio->io_size);
216 vdev_cache_entry_t *ve = fio->io_private;
226 ASSERT3P(ve->ve_fill_io, ==, fio);
227 ASSERT3U(ve->ve_offset, ==, fio->io_offset);
228 ASSERT3P(ve->ve_abd, ==, fio->io_abd);
230 ve->ve_fill_io = NULL;
239 vdev_cache_hit(vc, ve, pio);
241 if (fio->io_error || ve->ve_missed_update)
242 vdev_cache_evict(vc, ve);
254 vdev_cache_entry_t *ve, *ve_search;
279 ve = avl_find(&vc->vc_offset_tree, ve_search, NULL);
282 if (ve != NULL) {
283 if (ve->ve_missed_update) {
288 if ((fio = ve->ve_fill_io) != NULL) {
296 vdev_cache_hit(vc, ve, zio);
304 ve = vdev_cache_allocate(zio);
306 if (ve == NULL) {
312 ve->ve_abd, VCBS, ZIO_TYPE_READ, ZIO_PRIORITY_NOW,
313 ZIO_FLAG_DONT_CACHE, vdev_cache_fill, ve);
315 ve->ve_fill_io = fio;
333 vdev_cache_entry_t *ve, ve_search;
345 ve = avl_find(&vc->vc_offset_tree, &ve_search, &where);
347 if (ve == NULL)
348 ve = avl_nearest(&vc->vc_offset_tree, where, AVL_AFTER);
350 while (ve != NULL && ve->ve_offset < max_offset) {
351 uint64_t start = MAX(ve->ve_offset, io_start);
352 uint64_t end = MIN(ve->ve_offset + VCBS, io_end);
354 if (ve->ve_fill_io != NULL) {
355 ve->ve_missed_update = 1;
357 abd_copy_off(ve->ve_abd, zio->io_abd,
358 start - ve->ve_offset, start - io_start,
361 ve = AVL_NEXT(&vc->vc_offset_tree, ve);
370 vdev_cache_entry_t *ve;
373 while ((ve = avl_first(&vc->vc_offset_tree)) != NULL)
374 vdev_cache_evict(vc, ve);