mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Use list_remove_head() where possible.
... instead of list_head() + list_remove(). On FreeBSD the list functions are not inlined, so in addition to more compact code this also saves another function call. Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #14955
This commit is contained in:
@@ -88,14 +88,11 @@ zfs_refcount_destroy_many(zfs_refcount_t *rc, uint64_t number)
|
||||
reference_t *ref;
|
||||
|
||||
ASSERT3U(rc->rc_count, ==, number);
|
||||
while ((ref = list_head(&rc->rc_list))) {
|
||||
list_remove(&rc->rc_list, ref);
|
||||
while ((ref = list_remove_head(&rc->rc_list)))
|
||||
kmem_cache_free(reference_cache, ref);
|
||||
}
|
||||
list_destroy(&rc->rc_list);
|
||||
|
||||
while ((ref = list_head(&rc->rc_removed))) {
|
||||
list_remove(&rc->rc_removed, ref);
|
||||
while ((ref = list_remove_head(&rc->rc_removed))) {
|
||||
kmem_cache_free(reference_history_cache, ref->ref_removed);
|
||||
kmem_cache_free(reference_cache, ref);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user