summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include/linux/libcfs/libcfs.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-05-21 14:35:12 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-25 18:29:09 +0200
commit64bf0b1a079d61e9e059b9dc7a58e064c7d994ae (patch)
treead60e95d5bd9d94e2d8dec8bc41f16d6f3f6d907 /drivers/staging/lustre/include/linux/libcfs/libcfs.h
parente67f133d02e78c0c5e7c46ca84996aad3b25d8d1 (diff)
downloadop-kernel-dev-64bf0b1a079d61e9e059b9dc7a58e064c7d994ae.zip
op-kernel-dev-64bf0b1a079d61e9e059b9dc7a58e064c7d994ae.tar.gz
staging: lustre: refactor libcfs initialization.
Many lustre modules depend on libcfs having initialized properly, but do not explicit check that it did. When lustre is built as discrete modules, this does not cause a problem because if the libcfs module fails initialization, the other modules don't even get loaded. When lustre is compiled into the kernel, all module_init() routines get run, so they need to check the required initialization succeeded. This patch splits out the initialization of libcfs into a new libcfs_setup(), and has all modules call that. The misc_register() call is kept separate as it does not allocate any resources and if it fails, it fails hard - no point in retrying. Other set-up allocates resources and so is best delayed until they are needed, and can be worth retrying. Ideally, the initialization would happen at mount time (or similar) rather than at load time. Doing this requires each module to check dependencies when they are activated rather than when they are loaded. Achieving that is a much larger job that would have to progress in stages. For now, this change ensures that if some initialization in libcfs fails, other modules will fail-safe. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs/libcfs.h')
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index d420449..4c91ef4 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -137,6 +137,7 @@ struct libcfs_ioctl_handler {
int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand);
+int libcfs_setup(void);
#define _LIBCFS_H
OpenPOWER on IntegriCloud