Merge tag 'xfs-6.4-rc1-fixes' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-block.git] / include / linux / kmod.h
CommitLineData
74ba9207 1/* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4
LT
2#ifndef __LINUX_KMOD_H__
3#define __LINUX_KMOD_H__
4
5/*
6 * include/linux/kmod.h
1da177e4
LT
7 */
8
c1f3fa2a 9#include <linux/umh.h>
ac331d15 10#include <linux/gfp.h>
7888e7ff 11#include <linux/stddef.h>
1da177e4
LT
12#include <linux/errno.h>
13#include <linux/compiler.h>
a06a4dc3 14#include <linux/workqueue.h>
17f60a7d 15#include <linux/sysctl.h>
1da177e4
LT
16
17#define KMOD_PATH_LEN 256
18
a1ef5adb 19#ifdef CONFIG_MODULES
5ed10910 20extern char modprobe_path[]; /* for sysctl */
1da177e4
LT
21/* modprobe exit status on success, -ve on error. Return value
22 * usually useless though. */
b9075fa9
JP
23extern __printf(2, 3)
24int __request_module(bool wait, const char *name, ...);
acae0515
AV
25#define request_module(mod...) __request_module(true, mod)
26#define request_module_nowait(mod...) __request_module(false, mod)
27#define try_then_request_module(x, mod...) \
97c18e2c 28 ((x) ?: (__request_module(true, mod), (x)))
1da177e4 29#else
acae0515
AV
30static inline int request_module(const char *name, ...) { return -ENOSYS; }
31static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; }
df648c9f 32#define try_then_request_module(x, mod...) (x)
1da177e4
LT
33#endif
34
1da177e4 35#endif /* __LINUX_KMOD_H__ */