diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kmod.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 0509c4ce4857..a1a91577813c 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -19,6 +19,7 @@ | |||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/gfp.h> | ||
22 | #include <linux/stddef.h> | 23 | #include <linux/stddef.h> |
23 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
24 | #include <linux/compiler.h> | 25 | #include <linux/compiler.h> |
@@ -41,8 +42,8 @@ struct file; | |||
41 | struct subprocess_info; | 42 | struct subprocess_info; |
42 | 43 | ||
43 | /* Allocate a subprocess_info structure */ | 44 | /* Allocate a subprocess_info structure */ |
44 | struct subprocess_info *call_usermodehelper_setup(char *path, | 45 | struct subprocess_info *call_usermodehelper_setup(char *path, char **argv, |
45 | char **argv, char **envp); | 46 | char **envp, gfp_t gfp_mask); |
46 | 47 | ||
47 | /* Set various pieces of state into the subprocess_info structure */ | 48 | /* Set various pieces of state into the subprocess_info structure */ |
48 | void call_usermodehelper_setkeys(struct subprocess_info *info, | 49 | void call_usermodehelper_setkeys(struct subprocess_info *info, |
@@ -69,8 +70,9 @@ static inline int | |||
69 | call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) | 70 | call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) |
70 | { | 71 | { |
71 | struct subprocess_info *info; | 72 | struct subprocess_info *info; |
73 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; | ||
72 | 74 | ||
73 | info = call_usermodehelper_setup(path, argv, envp); | 75 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask); |
74 | if (info == NULL) | 76 | if (info == NULL) |
75 | return -ENOMEM; | 77 | return -ENOMEM; |
76 | return call_usermodehelper_exec(info, wait); | 78 | return call_usermodehelper_exec(info, wait); |
@@ -81,8 +83,9 @@ call_usermodehelper_keys(char *path, char **argv, char **envp, | |||
81 | struct key *session_keyring, enum umh_wait wait) | 83 | struct key *session_keyring, enum umh_wait wait) |
82 | { | 84 | { |
83 | struct subprocess_info *info; | 85 | struct subprocess_info *info; |
86 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; | ||
84 | 87 | ||
85 | info = call_usermodehelper_setup(path, argv, envp); | 88 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask); |
86 | if (info == NULL) | 89 | if (info == NULL) |
87 | return -ENOMEM; | 90 | return -ENOMEM; |
88 | 91 | ||