Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Make sure rl_t::r...
details: https://anonhg.NetBSD.org/src/rev/429dce067048
branches: trunk
changeset: 337320:429dce067048
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Apr 11 04:35:39 2015 +0000
description:
Make sure rl_t::r_zp is always initialized.
diffstat:
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (69 lines):
diff -r 2061876da1c6 -r 429dce067048 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c Sat Apr 11 03:23:37 2015 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c Sat Apr 11 04:35:39 2015 +0000
@@ -229,6 +229,7 @@
/* create a proxy range lock */
proxy = kmem_alloc(sizeof (rl_t), KM_SLEEP);
+ proxy->r_zp = rl->r_zp;
proxy->r_off = rl->r_off;
proxy->r_len = rl->r_len;
proxy->r_cnt = 1;
@@ -261,6 +262,7 @@
/* create the rear proxy range lock */
rear = kmem_alloc(sizeof (rl_t), KM_SLEEP);
+ rear->r_zp = rl->r_zp;
rear->r_off = off;
rear->r_len = rl->r_off + rl->r_len - off;
rear->r_cnt = rl->r_cnt;
@@ -283,12 +285,13 @@
* Create and add a new proxy range lock for the supplied range.
*/
static void
-zfs_range_new_proxy(avl_tree_t *tree, uint64_t off, uint64_t len)
+zfs_range_new_proxy(avl_tree_t *tree, uint64_t off, uint64_t len, znode_t *zp)
{
rl_t *rl;
ASSERT(len);
rl = kmem_alloc(sizeof (rl_t), KM_SLEEP);
+ rl->r_zp = zp;
rl->r_off = off;
rl->r_len = len;
rl->r_cnt = 1;
@@ -305,6 +308,7 @@
static void
zfs_range_add_reader(avl_tree_t *tree, rl_t *new, rl_t *prev, avl_index_t where)
{
+ znode_t *zp = new->r_zp;
rl_t *next;
uint64_t off = new->r_off;
uint64_t len = new->r_len;
@@ -343,7 +347,7 @@
if (off < next->r_off) {
/* Add a proxy for initial range before the overlap */
- zfs_range_new_proxy(tree, off, next->r_off - off);
+ zfs_range_new_proxy(tree, off, next->r_off - off, zp);
}
new->r_cnt = 0; /* will use proxies in tree */
@@ -360,7 +364,7 @@
/* there's a gap */
ASSERT3U(next->r_off, >, prev->r_off + prev->r_len);
zfs_range_new_proxy(tree, prev->r_off + prev->r_len,
- next->r_off - (prev->r_off + prev->r_len));
+ next->r_off - (prev->r_off + prev->r_len), zp);
}
if (off + len == next->r_off + next->r_len) {
/* exact overlap with end */
@@ -381,7 +385,7 @@
/* Add the remaining end range. */
zfs_range_new_proxy(tree, prev->r_off + prev->r_len,
- (off + len) - (prev->r_off + prev->r_len));
+ (off + len) - (prev->r_off + prev->r_len), zp);
}
/*
Home |
Main Index |
Thread Index |
Old Index