mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04: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:
+2
-5
@@ -1203,8 +1203,7 @@ zvol_create_minors_recursive(const char *name)
|
||||
* Prefetch is completed, we can do zvol_os_create_minor
|
||||
* sequentially.
|
||||
*/
|
||||
while ((job = list_head(&minors_list)) != NULL) {
|
||||
list_remove(&minors_list, job);
|
||||
while ((job = list_remove_head(&minors_list)) != NULL) {
|
||||
if (!job->error)
|
||||
(void) zvol_os_create_minor(job->name);
|
||||
kmem_strfree(job->name);
|
||||
@@ -1311,10 +1310,8 @@ zvol_remove_minors_impl(const char *name)
|
||||
rw_exit(&zvol_state_lock);
|
||||
|
||||
/* Drop zvol_state_lock before calling zvol_free() */
|
||||
while ((zv = list_head(&free_list)) != NULL) {
|
||||
list_remove(&free_list, zv);
|
||||
while ((zv = list_remove_head(&free_list)) != NULL)
|
||||
zvol_os_free(zv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove minor for this specific volume only */
|
||||
|
||||
Reference in New Issue
Block a user