summaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev_cache.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 11:00:46 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 08:38:49 -0700
commit5fed499defe68b57fab349ac945a84416fb024ba (patch)
tree42cec705699a7fd7159141dfcbc7096821201a68 /module/zfs/vdev_cache.c
parent47050a88ac1445f3557030d0d7e61b8a397a5476 (diff)
Fix stack vdev_cache_read()
Moving the vdev_cache_entry_t struct ve_search from the stack to the heap saves ~100 bytes. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/vdev_cache.c')
-rw-r--r--module/zfs/vdev_cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/module/zfs/vdev_cache.c b/module/zfs/vdev_cache.c
index a4b34423a..c5439bacc 100644
--- a/module/zfs/vdev_cache.c
+++ b/module/zfs/vdev_cache.c
@@ -244,7 +244,7 @@ int
vdev_cache_read(zio_t *zio)
{
vdev_cache_t *vc = &zio->io_vd->vdev_cache;
- vdev_cache_entry_t *ve, ve_search;
+ vdev_cache_entry_t *ve, *ve_search;
uint64_t cache_offset = P2ALIGN(zio->io_offset, VCBS);
ASSERTV(uint64_t cache_phase = P2PHASE(zio->io_offset, VCBS);)
zio_t *fio;
@@ -267,8 +267,10 @@ vdev_cache_read(zio_t *zio)
mutex_enter(&vc->vc_lock);
- ve_search.ve_offset = cache_offset;
- ve = avl_find(&vc->vc_offset_tree, &ve_search, NULL);
+ ve_search = kmem_alloc(sizeof(vdev_cache_entry_t), KM_SLEEP);
+ ve_search->ve_offset = cache_offset;
+ ve = avl_find(&vc->vc_offset_tree, ve_search, NULL);
+ kmem_free(ve_search, sizeof(vdev_cache_entry_t));
if (ve != NULL) {
if (ve->ve_missed_update) {