summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/refcount.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/fs/zfs/refcount.c')
-rw-r--r--usr/src/uts/common/fs/zfs/refcount.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/zfs/refcount.c b/usr/src/uts/common/fs/zfs/refcount.c
index cac716e469..657a46717c 100644
--- a/usr/src/uts/common/fs/zfs/refcount.c
+++ b/usr/src/uts/common/fs/zfs/refcount.c
@@ -234,9 +234,10 @@ zfs_refcount_transfer(zfs_refcount_t *dst, zfs_refcount_t *src)
list_destroy(&removed);
}
+/* ARGSUSED */
void
-zfs_refcount_transfer_ownership(zfs_refcount_t *rc, void *current_holder,
- void *new_holder)
+zfs_refcount_transfer_ownership_many(zfs_refcount_t *rc, uint64_t number,
+ void *current_holder, void *new_holder)
{
reference_t *ref;
boolean_t found = B_FALSE;
@@ -249,7 +250,8 @@ zfs_refcount_transfer_ownership(zfs_refcount_t *rc, void *current_holder,
for (ref = list_head(&rc->rc_list); ref;
ref = list_next(&rc->rc_list, ref)) {
- if (ref->ref_holder == current_holder) {
+ if (ref->ref_holder == current_holder &&
+ ref->ref_number == number) {
ref->ref_holder = new_holder;
found = B_TRUE;
break;
@@ -259,6 +261,14 @@ zfs_refcount_transfer_ownership(zfs_refcount_t *rc, void *current_holder,
mutex_exit(&rc->rc_mtx);
}
+void
+zfs_refcount_transfer_ownership(zfs_refcount_t *rc, void *current_holder,
+ void *new_holder)
+{
+ zfs_refcount_transfer_ownership_many(rc, 1, current_holder,
+ new_holder);
+}
+
/*
* If tracking is enabled, return true if a reference exists that matches
* the "holder" tag. If tracking is disabled, then return true if a reference