mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +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:
@@ -293,17 +293,16 @@ vdev_indirect_map_free(zio_t *zio)
|
||||
indirect_vsd_t *iv = zio->io_vsd;
|
||||
|
||||
indirect_split_t *is;
|
||||
while ((is = list_head(&iv->iv_splits)) != NULL) {
|
||||
while ((is = list_remove_head(&iv->iv_splits)) != NULL) {
|
||||
for (int c = 0; c < is->is_children; c++) {
|
||||
indirect_child_t *ic = &is->is_child[c];
|
||||
if (ic->ic_data != NULL)
|
||||
abd_free(ic->ic_data);
|
||||
}
|
||||
list_remove(&iv->iv_splits, is);
|
||||
|
||||
indirect_child_t *ic;
|
||||
while ((ic = list_head(&is->is_unique_child)) != NULL)
|
||||
list_remove(&is->is_unique_child, ic);
|
||||
while ((ic = list_remove_head(&is->is_unique_child)) != NULL)
|
||||
;
|
||||
|
||||
list_destroy(&is->is_unique_child);
|
||||
|
||||
@@ -1659,8 +1658,8 @@ out:
|
||||
for (indirect_split_t *is = list_head(&iv->iv_splits);
|
||||
is != NULL; is = list_next(&iv->iv_splits, is)) {
|
||||
indirect_child_t *ic;
|
||||
while ((ic = list_head(&is->is_unique_child)) != NULL)
|
||||
list_remove(&is->is_unique_child, ic);
|
||||
while ((ic = list_remove_head(&is->is_unique_child)) != NULL)
|
||||
;
|
||||
|
||||
is->is_unique_children = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user