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:
@@ -814,8 +814,7 @@ spa_remove(spa_t *spa)
|
||||
if (spa->spa_root)
|
||||
spa_strfree(spa->spa_root);
|
||||
|
||||
while ((dp = list_head(&spa->spa_config_list)) != NULL) {
|
||||
list_remove(&spa->spa_config_list, dp);
|
||||
while ((dp = list_remove_head(&spa->spa_config_list)) != NULL) {
|
||||
if (dp->scd_path != NULL)
|
||||
spa_strfree(dp->scd_path);
|
||||
kmem_free(dp, sizeof (spa_config_dirent_t));
|
||||
|
||||
Reference in New Issue
Block a user