Skip to content

Commit

Permalink
staging/lustre: fix Lustre init functions level
Browse files Browse the repository at this point in the history
Put libcfs in module_init() that is device_initcall() level. All
others are put in late_initcall(). Previously we define module_init()
as late_initcall() in lustre_compat25.h but it is not effective
for lnet.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
  • Loading branch information
bergwolf committed Jun 19, 2013
1 parent da598c2 commit 015a465
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ typedef struct task_struct task_t;
} while(0)

/* Module interfaces */
#define cfs_module(name, version, init, fini) \
module_init(init); \
#define cfs_module(name, version, init, fini) \
late_initcall(init); \
module_exit(fini)

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3255,5 +3255,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("Kernel OpenIB gen2 LND v2.00");
MODULE_LICENSE("GPL");

module_init(kiblnd_module_init);
late_initcall(kiblnd_module_init);
module_exit(kiblnd_module_fini);
11 changes: 0 additions & 11 deletions drivers/staging/lustre/lustre/include/linux/lustre_compat25.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
#define current_ngroups current_cred()->group_info->ngroups
#define current_groups current_cred()->group_info->small_block

/*
* OBD need working random driver, thus all our
* initialization routines must be called after device
* driver initialization
*/
#ifndef MODULE
#undef module_init
#define module_init(a) late_initcall(a)
#endif


#define LTIME_S(time) (time.tv_sec)

#define ll_permission(inode,mask,nd) inode_permission(inode,mask)
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/lustre/lustre/libcfs/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,5 @@ static void exit_libcfs_module(void)
libcfs_arch_cleanup();
}

cfs_module(libcfs, "1.0.0", init_libcfs_module, exit_libcfs_module);
module_init(init_libcfs_module);
module_exit(exit_libcfs_module);
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/llite/lloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ static void lloop_exit(void)
OBD_FREE(loop_dev, max_loop * sizeof(*loop_dev));
}

module_init(lloop_init);
late_initcall(lloop_init);
module_exit(lloop_exit);

CFS_MODULE_PARM(max_loop, "i", int, 0444, "maximum of lloop_device");
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/llite/super25.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("Lustre Lite Client File System");
MODULE_LICENSE("GPL");

module_init(init_lustre_lite);
late_initcall(init_lustre_lite);
module_exit(exit_lustre_lite);
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/lmv/lmv_obd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2723,5 +2723,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("Lustre Logical Metadata Volume OBD driver");
MODULE_LICENSE("GPL");

module_init(lmv_init);
late_initcall(lmv_init);
module_exit(lmv_exit);
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/lvfs/fsfilt_ext3.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ static void __exit fsfilt_ext3_exit(void)
LASSERTF(rc == 0, "couldn't destroy fcb_cache slab\n");
}

module_init(fsfilt_ext3_init);
late_initcall(fsfilt_ext3_init);
module_exit(fsfilt_ext3_exit);

MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/mdc/mdc_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -2749,5 +2749,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("Lustre Metadata Client");
MODULE_LICENSE("GPL");

module_init(mdc_init);
late_initcall(mdc_init);
module_exit(mdc_exit);
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/mgc/mgc_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,5 +1856,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("Lustre Management Client");
MODULE_LICENSE("GPL");

module_init(mgc_init);
late_initcall(mgc_init);
module_exit(mgc_exit);
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/obdclass/llog_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,5 +1083,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("llog test module");
MODULE_LICENSE("GPL");

module_init(llog_test_init);
late_initcall(llog_test_init);
module_exit(llog_test_exit);
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/ptlrpc/gss/sec_gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2912,5 +2912,5 @@ MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("GSS security policy for Lustre");
MODULE_LICENSE("GPL");

module_init(sptlrpc_gss_init);
late_initcall(sptlrpc_gss_init);
module_exit(sptlrpc_gss_exit);

1 comment on commit 015a465

@adilger
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok.

Please sign in to comment.