summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
index 717368c..f36b191 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
@@ -1342,8 +1342,8 @@ fzap_get_stats(zap_t *zap, zap_stats_t *zs)
}
int
-fzap_count_write(zap_name_t *zn, int add, uint64_t *towrite,
- uint64_t *tooverwrite)
+fzap_count_write(zap_name_t *zn, int add, refcount_t *towrite,
+ refcount_t *tooverwrite)
{
zap_t *zap = zn->zn_zap;
zap_leaf_t *l;
@@ -1353,9 +1353,11 @@ fzap_count_write(zap_name_t *zn, int add, uint64_t *towrite,
* Account for the header block of the fatzap.
*/
if (!add && dmu_buf_freeable(zap->zap_dbuf)) {
- *tooverwrite += zap->zap_dbuf->db_size;
+ (void) refcount_add_many(tooverwrite,
+ zap->zap_dbuf->db_size, FTAG);
} else {
- *towrite += zap->zap_dbuf->db_size;
+ (void) refcount_add_many(towrite,
+ zap->zap_dbuf->db_size, FTAG);
}
/*
@@ -1367,10 +1369,13 @@ fzap_count_write(zap_name_t *zn, int add, uint64_t *towrite,
* could extend the table.
*/
if (add) {
- if (zap_f_phys(zap)->zap_ptrtbl.zt_blk == 0)
- *towrite += zap->zap_dbuf->db_size;
- else
- *towrite += (zap->zap_dbuf->db_size * 3);
+ if (zap_f_phys(zap)->zap_ptrtbl.zt_blk == 0) {
+ (void) refcount_add_many(towrite,
+ zap->zap_dbuf->db_size, FTAG);
+ } else {
+ (void) refcount_add_many(towrite,
+ zap->zap_dbuf->db_size * 3, FTAG);
+ }
}
/*
@@ -1383,13 +1388,14 @@ fzap_count_write(zap_name_t *zn, int add, uint64_t *towrite,
}
if (!add && dmu_buf_freeable(l->l_dbuf)) {
- *tooverwrite += l->l_dbuf->db_size;
+ (void) refcount_add_many(tooverwrite, l->l_dbuf->db_size, FTAG);
} else {
/*
* If this an add operation, the leaf block could split.
* Hence, we need to account for an additional leaf block.
*/
- *towrite += (add ? 2 : 1) * l->l_dbuf->db_size;
+ (void) refcount_add_many(towrite,
+ (add ? 2 : 1) * l->l_dbuf->db_size, FTAG);
}
zap_put_leaf(l);
OpenPOWER on IntegriCloud