Skip to content

Commit

Permalink
10343 ZoL: Prefix all refcount functions with zfs_
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Franz Pletz <fpletz@fnordicwalking.de>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
timschumi authored and rmustacc committed Feb 21, 2019
1 parent 7957da4 commit e914ace
Show file tree
Hide file tree
Showing 27 changed files with 408 additions and 389 deletions.
22 changes: 11 additions & 11 deletions usr/src/uts/common/fs/zfs/abd.c
Expand Up @@ -291,7 +291,7 @@ abd_alloc(size_t size, boolean_t is_metadata)
}
abd->abd_size = size;
abd->abd_parent = NULL;
refcount_create(&abd->abd_children);
zfs_refcount_create(&abd->abd_children);

abd->abd_u.abd_scatter.abd_offset = 0;
abd->abd_u.abd_scatter.abd_chunk_size = zfs_abd_chunk_size;
Expand All @@ -318,7 +318,7 @@ abd_free_scatter(abd_t *abd)
abd_free_chunk(abd->abd_u.abd_scatter.abd_chunks[i]);
}

refcount_destroy(&abd->abd_children);
zfs_refcount_destroy(&abd->abd_children);
ABDSTAT_BUMPDOWN(abdstat_scatter_cnt);
ABDSTAT_INCR(abdstat_scatter_data_size, -(int)abd->abd_size);
ABDSTAT_INCR(abdstat_scatter_chunk_waste,
Expand All @@ -345,7 +345,7 @@ abd_alloc_linear(size_t size, boolean_t is_metadata)
}
abd->abd_size = size;
abd->abd_parent = NULL;
refcount_create(&abd->abd_children);
zfs_refcount_create(&abd->abd_children);

if (is_metadata) {
abd->abd_u.abd_linear.abd_buf = zio_buf_alloc(size);
Expand All @@ -368,7 +368,7 @@ abd_free_linear(abd_t *abd)
zio_data_buf_free(abd->abd_u.abd_linear.abd_buf, abd->abd_size);
}

refcount_destroy(&abd->abd_children);
zfs_refcount_destroy(&abd->abd_children);
ABDSTAT_BUMPDOWN(abdstat_linear_cnt);
ABDSTAT_INCR(abdstat_linear_data_size, -(int)abd->abd_size);

Expand Down Expand Up @@ -474,8 +474,8 @@ abd_get_offset(abd_t *sabd, size_t off)

abd->abd_size = sabd->abd_size - off;
abd->abd_parent = sabd;
refcount_create(&abd->abd_children);
(void) refcount_add_many(&sabd->abd_children, abd->abd_size, abd);
zfs_refcount_create(&abd->abd_children);
(void) zfs_refcount_add_many(&sabd->abd_children, abd->abd_size, abd);

return (abd);
}
Expand All @@ -499,7 +499,7 @@ abd_get_from_buf(void *buf, size_t size)
abd->abd_flags = ABD_FLAG_LINEAR;
abd->abd_size = size;
abd->abd_parent = NULL;
refcount_create(&abd->abd_children);
zfs_refcount_create(&abd->abd_children);

abd->abd_u.abd_linear.abd_buf = buf;

Expand All @@ -517,11 +517,11 @@ abd_put(abd_t *abd)
ASSERT(!(abd->abd_flags & ABD_FLAG_OWNER));

if (abd->abd_parent != NULL) {
(void) refcount_remove_many(&abd->abd_parent->abd_children,
(void) zfs_refcount_remove_many(&abd->abd_parent->abd_children,
abd->abd_size, abd);
}

refcount_destroy(&abd->abd_children);
zfs_refcount_destroy(&abd->abd_children);
abd_free_struct(abd);
}

Expand Down Expand Up @@ -553,7 +553,7 @@ abd_borrow_buf(abd_t *abd, size_t n)
} else {
buf = zio_buf_alloc(n);
}
(void) refcount_add_many(&abd->abd_children, n, buf);
(void) zfs_refcount_add_many(&abd->abd_children, n, buf);

return (buf);
}
Expand Down Expand Up @@ -585,7 +585,7 @@ abd_return_buf(abd_t *abd, void *buf, size_t n)
ASSERT0(abd_cmp_buf(abd, buf, n));
zio_buf_free(buf, n);
}
(void) refcount_remove_many(&abd->abd_children, n, buf);
(void) zfs_refcount_remove_many(&abd->abd_children, n, buf);
}

void
Expand Down

0 comments on commit e914ace

Please sign in to comment.