git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix gcc init pragma warnings
[zfs.git]
/
module
/
zfs
/
vdev_cache.c
diff --git
a/module/zfs/vdev_cache.c
b/module/zfs/vdev_cache.c
index
5a7b59f
..
688d541
100644
(file)
--- a/
module/zfs/vdev_cache.c
+++ b/
module/zfs/vdev_cache.c
@@
-19,7
+19,7
@@
* CDDL HEADER END
*/
/*
* CDDL HEADER END
*/
/*
- * Copyright 200
8
Sun Microsystems, Inc. All rights reserved.
+ * Copyright 200
9
Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
* Use is subject to license terms.
*/
@@
-172,7
+172,7
@@
vdev_cache_allocate(zio_t *zio)
ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_SLEEP);
ve->ve_offset = offset;
ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_SLEEP);
ve->ve_offset = offset;
- ve->ve_lastused =
lbolt
;
+ ve->ve_lastused =
ddi_get_lbolt()
;
ve->ve_data = zio_buf_alloc(VCBS);
avl_add(&vc->vc_offset_tree, ve);
ve->ve_data = zio_buf_alloc(VCBS);
avl_add(&vc->vc_offset_tree, ve);
@@
-189,9
+189,9
@@
vdev_cache_hit(vdev_cache_t *vc, vdev_cache_entry_t *ve, zio_t *zio)
ASSERT(MUTEX_HELD(&vc->vc_lock));
ASSERT(ve->ve_fill_io == NULL);
ASSERT(MUTEX_HELD(&vc->vc_lock));
ASSERT(ve->ve_fill_io == NULL);
- if (ve->ve_lastused !=
lbolt
) {
+ if (ve->ve_lastused !=
ddi_get_lbolt()
) {
avl_remove(&vc->vc_lastused_tree, ve);
avl_remove(&vc->vc_lastused_tree, ve);
- ve->ve_lastused =
lbolt
;
+ ve->ve_lastused =
ddi_get_lbolt()
;
avl_add(&vc->vc_lastused_tree, ve);
}
avl_add(&vc->vc_lastused_tree, ve);
}
@@
-203,23
+203,23
@@
vdev_cache_hit(vdev_cache_t *vc, vdev_cache_entry_t *ve, zio_t *zio)
* Fill a previously allocated cache entry with data.
*/
static void
* Fill a previously allocated cache entry with data.
*/
static void
-vdev_cache_fill(zio_t *
z
io)
+vdev_cache_fill(zio_t *
f
io)
{
{
- vdev_t *vd =
z
io->io_vd;
+ vdev_t *vd =
f
io->io_vd;
vdev_cache_t *vc = &vd->vdev_cache;
vdev_cache_t *vc = &vd->vdev_cache;
- vdev_cache_entry_t *ve =
z
io->io_private;
- zio_t *
d
io;
+ vdev_cache_entry_t *ve =
f
io->io_private;
+ zio_t *
p
io;
- ASSERT(
z
io->io_size == VCBS);
+ ASSERT(
f
io->io_size == VCBS);
/*
* Add data to the cache.
*/
mutex_enter(&vc->vc_lock);
/*
* Add data to the cache.
*/
mutex_enter(&vc->vc_lock);
- ASSERT(ve->ve_fill_io ==
z
io);
- ASSERT(ve->ve_offset ==
z
io->io_offset);
- ASSERT(ve->ve_data ==
z
io->io_data);
+ ASSERT(ve->ve_fill_io ==
f
io);
+ ASSERT(ve->ve_offset ==
f
io->io_offset);
+ ASSERT(ve->ve_data ==
f
io->io_data);
ve->ve_fill_io = NULL;
ve->ve_fill_io = NULL;
@@
-228,20
+228,13
@@
vdev_cache_fill(zio_t *zio)
* any reads that were queued up before the missed update are still
* valid, so we can satisfy them from this line before we evict it.
*/
* any reads that were queued up before the missed update are still
* valid, so we can satisfy them from this line before we evict it.
*/
-
for (dio = zio->io_delegate_list; dio; dio = dio->io_delegate_next
)
- vdev_cache_hit(vc, ve,
d
io);
+
while ((pio = zio_walk_parents(fio)) != NULL
)
+ vdev_cache_hit(vc, ve,
p
io);
- if (
z
io->io_error || ve->ve_missed_update)
+ if (
f
io->io_error || ve->ve_missed_update)
vdev_cache_evict(vc, ve);
mutex_exit(&vc->vc_lock);
vdev_cache_evict(vc, ve);
mutex_exit(&vc->vc_lock);
-
- while ((dio = zio->io_delegate_list) != NULL) {
- zio->io_delegate_list = dio->io_delegate_next;
- dio->io_delegate_next = NULL;
- dio->io_error = zio->io_error;
- zio_execute(dio);
- }
}
/*
}
/*
@@
-284,9
+277,8
@@
vdev_cache_read(zio_t *zio)
}
if ((fio = ve->ve_fill_io) != NULL) {
}
if ((fio = ve->ve_fill_io) != NULL) {
- zio->io_delegate_next = fio->io_delegate_list;
- fio->io_delegate_list = zio;
zio_vdev_io_bypass(zio);
zio_vdev_io_bypass(zio);
+ zio_add_child(zio, fio);
mutex_exit(&vc->vc_lock);
VDCSTAT_BUMP(vdc_stat_delegations);
return (0);
mutex_exit(&vc->vc_lock);
VDCSTAT_BUMP(vdc_stat_delegations);
return (0);
@@
-296,7
+288,6
@@
vdev_cache_read(zio_t *zio)
zio_vdev_io_bypass(zio);
mutex_exit(&vc->vc_lock);
zio_vdev_io_bypass(zio);
mutex_exit(&vc->vc_lock);
- zio_execute(zio);
VDCSTAT_BUMP(vdc_stat_hits);
return (0);
}
VDCSTAT_BUMP(vdc_stat_hits);
return (0);
}
@@
-313,8
+304,8
@@
vdev_cache_read(zio_t *zio)
ZIO_FLAG_DONT_CACHE, vdev_cache_fill, ve);
ve->ve_fill_io = fio;
ZIO_FLAG_DONT_CACHE, vdev_cache_fill, ve);
ve->ve_fill_io = fio;
- fio->io_delegate_list = zio;
zio_vdev_io_bypass(zio);
zio_vdev_io_bypass(zio);
+ zio_add_child(zio, fio);
mutex_exit(&vc->vc_lock);
zio_nowait(fio);
mutex_exit(&vc->vc_lock);
zio_nowait(fio);