git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Register correct handlers in nvlist_alloc()
[zfs.git]
/
module
/
nvpair
/
nvpair.c
diff --git
a/module/nvpair/nvpair.c
b/module/nvpair/nvpair.c
index
5c68984
..
36f4e4d
100644
(file)
--- a/
module/nvpair/nvpair.c
+++ b/
module/nvpair/nvpair.c
@@
-269,12
+269,25
@@
nvlist_nvflag(nvlist_t *nvl)
int
nvlist_alloc(nvlist_t **nvlp, uint_t nvflag, int kmflag)
{
int
nvlist_alloc(nvlist_t **nvlp, uint_t nvflag, int kmflag)
{
+ nv_alloc_t *nva = nv_alloc_nosleep;
+
#if defined(_KERNEL) && !defined(_BOOT)
#if defined(_KERNEL) && !defined(_BOOT)
- return (nvlist_xalloc(nvlp, nvflag,
- (kmflag == KM_SLEEP ? nv_alloc_sleep : nv_alloc_nosleep)));
-#else
- return (nvlist_xalloc(nvlp, nvflag, nv_alloc_nosleep));
+ switch (kmflag) {
+ case KM_SLEEP:
+ nva = nv_alloc_sleep;
+ break;
+ case KM_PUSHPAGE:
+ nva = nv_alloc_pushpage;
+ break;
+ case KM_NOSLEEP:
+ nva = nv_alloc_nosleep;
+ break;
+ default:
+ return (EINVAL);
+ }
#endif
#endif
+
+ return (nvlist_xalloc(nvlp, nvflag, nva));
}
int
}
int