Skip to content

Commit

Permalink
Restructure nvlist_nv_alloc to work on FreeBSD
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes openzfs#9643
  • Loading branch information
mattmacy authored and behlendorf committed Nov 30, 2019
1 parent 101f9b1 commit 758699b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/nvpair/nvpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 758699b

Please sign in to comment.