MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vdev_cache_hit

Function vdev_cache_hit

freebsd/contrib/openzfs/module/zfs/vdev_cache.c:190–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static void
191vdev_cache_hit(vdev_cache_t *vc, vdev_cache_entry_t *ve, zio_t *zio)
192{
193 uint64_t cache_phase = P2PHASE(zio->io_offset, VCBS);
194
195 ASSERT(MUTEX_HELD(&vc->vc_lock));
196 ASSERT3P(ve->ve_fill_io, ==, NULL);
197
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);
202 }
203
204 ve->ve_hits++;
205 abd_copy_off(zio->io_abd, ve->ve_abd, 0, cache_phase, zio->io_size);
206}
207
208/*
209 * Fill a previously allocated cache entry with data.

Callers 2

vdev_cache_fillFunction · 0.85
vdev_cache_readFunction · 0.85

Calls 3

avl_removeFunction · 0.85
avl_addFunction · 0.85
abd_copy_offFunction · 0.85

Tested by

no test coverage detected