mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +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:
@@ -87,8 +87,7 @@ zfs_onexit_destroy(zfs_onexit_t *zo)
|
||||
zfs_onexit_action_node_t *ap;
|
||||
|
||||
mutex_enter(&zo->zo_lock);
|
||||
while ((ap = list_head(&zo->zo_actions)) != NULL) {
|
||||
list_remove(&zo->zo_actions, ap);
|
||||
while ((ap = list_remove_head(&zo->zo_actions)) != NULL) {
|
||||
mutex_exit(&zo->zo_lock);
|
||||
ap->za_func(ap->za_data);
|
||||
kmem_free(ap, sizeof (zfs_onexit_action_node_t));
|
||||
|
||||
Reference in New Issue
Block a user