]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Restructure nvlist_nv_alloc to work on FreeBSD
authorMatthew Macy <mmacy@freebsd.org>
Sat, 30 Nov 2019 23:45:07 +0000 (15:45 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 30 Nov 2019 23:45:06 +0000 (15:45 -0800)
KM_PUSHPAGE is an Illumosism - On FreeBSD it's
aliased to the same malloc flag as KM_SLEEP.
The compiler naturally rejects multiple case
statements with the same value.  This is effectively
a no-op since all callers pass a specific KM_* flag.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9643

module/nvpair/nvpair.c

index dd8a9420d5154201f8f2cc5ce8fda0e33717a0e2..6c6a58e8563a506217613ec0eab267be8eebd6d9 100644 (file)
@@ -558,10 +558,10 @@ nvlist_nv_alloc(int kmflag)
        switch (kmflag) {
        case KM_SLEEP:
                return (nv_alloc_sleep);
-       case KM_PUSHPAGE:
-               return (nv_alloc_pushpage);
-       default:
+       case KM_NOSLEEP:
                return (nv_alloc_nosleep);
+       default:
+               return (nv_alloc_pushpage);
        }
 #else
        return (nv_alloc_nosleep);