diff options
author | Alexander Motin <[email protected]> | 2023-06-09 13:12:52 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-09 10:12:52 -0700 |
commit | b3ad3f48d9d215ce9bea1090d86ced17862ea441 (patch) | |
tree | 1e0b2cf93d6957ae38b9c924a49ccd9af1ef3916 /module/zfs/zfs_fuid.c | |
parent | 55b1842f92a24fe7192d129bca7b60882080d31a (diff) |
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored by: iXsystems, Inc.
Closes #14955
Diffstat (limited to 'module/zfs/zfs_fuid.c')
-rw-r--r-- | module/zfs/zfs_fuid.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/module/zfs/zfs_fuid.c b/module/zfs/zfs_fuid.c index 44aaae9c1..add4241dc 100644 --- a/module/zfs/zfs_fuid.c +++ b/module/zfs/zfs_fuid.c @@ -699,19 +699,15 @@ zfs_fuid_info_free(zfs_fuid_info_t *fuidp) zfs_fuid_t *zfuid; zfs_fuid_domain_t *zdomain; - while ((zfuid = list_head(&fuidp->z_fuids)) != NULL) { - list_remove(&fuidp->z_fuids, zfuid); + while ((zfuid = list_remove_head(&fuidp->z_fuids)) != NULL) kmem_free(zfuid, sizeof (zfs_fuid_t)); - } if (fuidp->z_domain_table != NULL) kmem_free(fuidp->z_domain_table, (sizeof (char *)) * fuidp->z_domain_cnt); - while ((zdomain = list_head(&fuidp->z_domains)) != NULL) { - list_remove(&fuidp->z_domains, zdomain); + while ((zdomain = list_remove_head(&fuidp->z_domains)) != NULL) kmem_free(zdomain, sizeof (zfs_fuid_domain_t)); - } kmem_free(fuidp, sizeof (zfs_fuid_info_t)); } |