From 671c1b0c705640d63a1d3be7016c79afd10bc8df Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 19 Oct 2015 11:24:22 -0400 Subject: [PATCH 1/1] LU-6204 build: clean up kernel module metadata Update static MODULE_VERSION() lines - this should be automated. Improve MODULE_DESCRIPTION() descriptions. Make the name of the module_init()/_exit() functions consistently {module_name}_init and {module_name}_exit. Signed-off-by: Andreas Dilger Change-Id: I1c3fe5698c7f41d971a38225650597c913500c1e Reviewed-on: http://review.whamcloud.com/16787 Tested-by: Jenkins Reviewed-by: John L. Hammond Reviewed-by: Dmitry Eremin Reviewed-by: Frank Zago Tested-by: Maloo Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/libcfs.h | 2 ++ libcfs/libcfs/module.c | 12 ++++---- lnet/include/lnet/lib-lnet.h | 4 +-- lnet/include/lnet/types.h | 2 ++ lnet/klnds/gnilnd/gnilnd.c | 13 ++++----- lnet/klnds/o2iblnd/o2iblnd.c | 41 +++++++++++++------------- lnet/klnds/socklnd/socklnd.c | 62 +++++++++++++++++++--------------------- lnet/lnet/api-ni.c | 17 ++++++----- lnet/lnet/module.c | 22 +++++++------- lnet/selftest/module.c | 12 ++++---- lustre/fid/fid_request.c | 10 +++---- lustre/fld/fld_request.c | 10 +++---- lustre/lfsck/lfsck_lib.c | 2 +- lustre/llite/lloop.c | 26 ++++++++--------- lustre/llite/super25.c | 10 +++---- lustre/lmv/lmv_obd.c | 8 +++--- lustre/lod/lod_dev.c | 9 +++--- lustre/lov/lov_obd.c | 4 +-- lustre/mdc/mdc_request.c | 2 +- lustre/mdd/mdd_device.c | 10 +++---- lustre/mdt/mdt_handler.c | 8 +++--- lustre/mgc/mgc_request.c | 2 +- lustre/mgs/mgs_handler.c | 4 +-- lustre/obdclass/class_obd.c | 12 ++++---- lustre/obdclass/llog_test.c | 2 +- lustre/obdecho/echo_client.c | 45 +++++++++++------------------ lustre/osc/osc_request.c | 2 +- lustre/osd-ldiskfs/osd_handler.c | 8 +++--- lustre/osd-zfs/osd_handler.c | 4 +-- lustre/osp/osp_dev.c | 10 +++---- lustre/ost/ost_handler.c | 4 +-- lustre/ptlrpc/gss/sec_gss.c | 4 +-- lustre/quota/lquota_lib.c | 8 +++--- 33 files changed, 187 insertions(+), 204 deletions(-) diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index ab8cab4..d02ec25 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -67,6 +67,8 @@ #include "curproc.h" +#define LIBCFS_VERSION "0.5.0" + #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0]))) #endif diff --git a/libcfs/libcfs/module.c b/libcfs/libcfs/module.c index 93d68ef..6b3ace5 100644 --- a/libcfs/libcfs/module.c +++ b/libcfs/libcfs/module.c @@ -307,7 +307,7 @@ struct cfs_psdev_ops libcfs_psdev_ops = { libcfs_ioctl }; -static int init_libcfs_module(void) +static int __init libcfs_init(void) { int rc; @@ -370,7 +370,7 @@ cleanup_debug: return rc; } -static void exit_libcfs_module(void) +static void __exit libcfs_exit(void) { int rc; @@ -402,9 +402,9 @@ static void exit_libcfs_module(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Libcfs v3.1"); -MODULE_VERSION("1.0.0"); +MODULE_DESCRIPTION("Lustre helper library"); +MODULE_VERSION(LIBCFS_VERSION); MODULE_LICENSE("GPL"); -module_init(init_libcfs_module); -module_exit(exit_libcfs_module); +module_init(libcfs_init); +module_exit(libcfs_exit); diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 8dd713d..fa1fd33 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -457,8 +457,8 @@ extern lnet_ni_t *lnet_nid2ni_locked(lnet_nid_t nid, int cpt); extern lnet_ni_t *lnet_net2ni_locked(__u32 net, int cpt); extern lnet_ni_t *lnet_net2ni(__u32 net); -int lnet_init(void); -void lnet_fini(void); +int lnet_lib_init(void); +void lnet_lib_exit(void); extern int portal_rotor; diff --git a/lnet/include/lnet/types.h b/lnet/include/lnet/types.h index 62480c3..9c31da4 100644 --- a/lnet/include/lnet/types.h +++ b/lnet/include/lnet/types.h @@ -45,6 +45,8 @@ /** \addtogroup lnet_addr * @{ */ +#define LNET_VERSION "0.7.0" + /** Portal reserved for LNet's own use. * \see lustre/include/lustre/lustre_idl.h for Lustre portal assignments. */ diff --git a/lnet/klnds/gnilnd/gnilnd.c b/lnet/klnds/gnilnd/gnilnd.c index be104c3..20d0730 100644 --- a/lnet/klnds/gnilnd/gnilnd.c +++ b/lnet/klnds/gnilnd/gnilnd.c @@ -2878,8 +2878,7 @@ out: EXIT; } -void __exit -kgnilnd_module_fini(void) +static void __exit kgnilnd_exit(void) { lnet_unregister_lnd(&the_kgnilnd); kgnilnd_proc_fini(); @@ -2887,8 +2886,7 @@ kgnilnd_module_fini(void) kgnilnd_tunables_fini(); } -int __init -kgnilnd_module_init(void) +static int __init kgnilnd_init(void) { int rc; @@ -2907,8 +2905,9 @@ kgnilnd_module_init(void) } MODULE_AUTHOR("Cray, Inc. "); -MODULE_DESCRIPTION("Kernel Gemini LND v"KGNILND_BUILD_REV); +MODULE_DESCRIPTION("Gemini LNet Network Driver"); +MODULE_VERSION(KGNILND_BUILD_REV); MODULE_LICENSE("GPL"); -module_init(kgnilnd_module_init); -module_exit(kgnilnd_module_fini); +module_init(kgnilnd_init); +module_exit(kgnilnd_exit); diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 7df02d1..c7edbba 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -2940,36 +2940,37 @@ static lnd_t the_o2iblnd = { .lnd_recv = kiblnd_recv, }; -static void __exit -kiblnd_module_fini (void) +static void __exit ko2iblnd_exit(void) { - lnet_unregister_lnd(&the_o2iblnd); - kiblnd_tunables_fini(); + lnet_unregister_lnd(&the_o2iblnd); + kiblnd_tunables_fini(); } -static int __init -kiblnd_module_init (void) +static int __init ko2iblnd_init(void) { - int rc; + int rc; - CLASSERT (sizeof(kib_msg_t) <= IBLND_MSG_SIZE); - CLASSERT (offsetof(kib_msg_t, ibm_u.get.ibgm_rd.rd_frags[IBLND_MAX_RDMA_FRAGS]) - <= IBLND_MSG_SIZE); - CLASSERT (offsetof(kib_msg_t, ibm_u.putack.ibpam_rd.rd_frags[IBLND_MAX_RDMA_FRAGS]) - <= IBLND_MSG_SIZE); + CLASSERT(sizeof(kib_msg_t) <= IBLND_MSG_SIZE); + CLASSERT(offsetof(kib_msg_t, + ibm_u.get.ibgm_rd.rd_frags[IBLND_MAX_RDMA_FRAGS]) <= + IBLND_MSG_SIZE); + CLASSERT(offsetof(kib_msg_t, + ibm_u.putack.ibpam_rd.rd_frags[IBLND_MAX_RDMA_FRAGS]) + <= IBLND_MSG_SIZE); - rc = kiblnd_tunables_init(); - if (rc != 0) - return rc; + rc = kiblnd_tunables_init(); + if (rc != 0) + return rc; - lnet_register_lnd(&the_o2iblnd); + lnet_register_lnd(&the_o2iblnd); - return 0; + return 0; } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Kernel OpenIB gen2 LND v2.00"); +MODULE_DESCRIPTION("OpenIB gen2 LNet Network Driver"); +MODULE_VERSION("2.8.0"); MODULE_LICENSE("GPL"); -module_init(kiblnd_module_init); -module_exit(kiblnd_module_fini); +module_init(ko2iblnd_init); +module_exit(ko2iblnd_exit); diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 69fb232..873e1ac 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -2865,46 +2865,44 @@ ksocknal_startup (lnet_ni_t *ni) } -static void __exit -ksocknal_module_fini (void) +static void __exit ksocklnd_exit(void) { - lnet_unregister_lnd(&the_ksocklnd); - ksocknal_tunables_fini(); + lnet_unregister_lnd(&the_ksocklnd); + ksocknal_tunables_fini(); } -static int __init -ksocknal_module_init (void) +static int __init ksocklnd_init(void) { - int rc; - - /* check ksnr_connected/connecting field large enough */ - CLASSERT (SOCKLND_CONN_NTYPES <= 4); - CLASSERT (SOCKLND_CONN_ACK == SOCKLND_CONN_BULK_IN); - - /* initialize the_ksocklnd */ - the_ksocklnd.lnd_type = SOCKLND; - the_ksocklnd.lnd_startup = ksocknal_startup; - the_ksocklnd.lnd_shutdown = ksocknal_shutdown; - the_ksocklnd.lnd_ctl = ksocknal_ctl; - the_ksocklnd.lnd_send = ksocknal_send; - the_ksocklnd.lnd_recv = ksocknal_recv; - the_ksocklnd.lnd_notify = ksocknal_notify; - the_ksocklnd.lnd_query = ksocknal_query; - the_ksocklnd.lnd_accept = ksocknal_accept; - - rc = ksocknal_tunables_init(); - if (rc != 0) - return rc; + int rc; + + /* check ksnr_connected/connecting field large enough */ + CLASSERT(SOCKLND_CONN_NTYPES <= 4); + CLASSERT(SOCKLND_CONN_ACK == SOCKLND_CONN_BULK_IN); + + /* initialize the_ksocklnd */ + the_ksocklnd.lnd_type = SOCKLND; + the_ksocklnd.lnd_startup = ksocknal_startup; + the_ksocklnd.lnd_shutdown = ksocknal_shutdown; + the_ksocklnd.lnd_ctl = ksocknal_ctl; + the_ksocklnd.lnd_send = ksocknal_send; + the_ksocklnd.lnd_recv = ksocknal_recv; + the_ksocklnd.lnd_notify = ksocknal_notify; + the_ksocklnd.lnd_query = ksocknal_query; + the_ksocklnd.lnd_accept = ksocknal_accept; + + rc = ksocknal_tunables_init(); + if (rc != 0) + return rc; - lnet_register_lnd(&the_ksocklnd); + lnet_register_lnd(&the_ksocklnd); - return 0; + return 0; } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Kernel TCP Socket LND v3.0.0"); -MODULE_VERSION("3.0.0"); +MODULE_DESCRIPTION("TCP Socket LNet Network Driver"); +MODULE_VERSION("2.8.0"); MODULE_LICENSE("GPL"); -module_init(ksocknal_module_init); -module_exit(ksocknal_module_fini); +module_init(ksocklnd_init); +module_exit(ksocklnd_exit); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 3e8d0a9..0302f67 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -1398,15 +1398,15 @@ failed: * Initialize LNet library. * * Automatically called at module loading time. Caller has to call - * lnet_fini() after a call to lnet_init(), if and only if the latter - * returned 0. It must be called exactly once. + * lnet_lib_exit() after a call to lnet_lib_init(), if and only if the + * latter returned 0. It must be called exactly once. * - * \return 0 on success, and -ve on failures. + * \retval 0 on success + * \retval -ve on failures. */ -int -lnet_init(void) +int lnet_lib_init(void) { - int rc; + int rc; lnet_assert_wire_constants(); @@ -1460,11 +1460,10 @@ lnet_init(void) /** * Finalize LNet library. * - * \pre lnet_init() called with success. + * \pre lnet_lib_init() called with success. * \pre All LNet users called LNetNIFini() for matching LNetNIInit() calls. */ -void -lnet_fini(void) +void lnet_lib_exit(void) { LASSERT(the_lnet.ln_refcount == 0); diff --git a/lnet/lnet/module.c b/lnet/lnet/module.c index 8e1ab43..7cabfde 100644 --- a/lnet/lnet/module.c +++ b/lnet/lnet/module.c @@ -173,17 +173,16 @@ lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_hdr *hdr) DECLARE_IOCTL_HANDLER(lnet_ioctl_handler, lnet_ioctl); -static int -lnet_module_init(void) +static int __init lnet_init(void) { int rc; ENTRY; mutex_init(&lnet_config_mutex); - rc = lnet_init(); + rc = lnet_lib_init(); if (rc != 0) { - CERROR("lnet_init: error %d\n", rc); + CERROR("lnet_lib_init: error %d\n", rc); RETURN(rc); } @@ -193,27 +192,26 @@ lnet_module_init(void) if (config_on_load) { /* Have to schedule a separate thread to avoid deadlocking * in modload */ - (void) kthread_run(lnet_configure, NULL, "lnet_initd"); + (void)kthread_run(lnet_configure, NULL, "lnet_initd"); } RETURN(0); } -static void -lnet_module_exit(void) +static void __exit lnet_exit(void) { int rc; rc = libcfs_deregister_ioctl(&lnet_ioctl_handler); LASSERT(rc == 0); - lnet_fini(); + lnet_lib_exit(); } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("LNet v3.1"); -MODULE_VERSION("1.0.0"); +MODULE_DESCRIPTION("Lustre Networking layer"); +MODULE_VERSION(LNET_VERSION); MODULE_LICENSE("GPL"); -module_init(lnet_module_init); -module_exit(lnet_module_exit); +module_init(lnet_init); +module_exit(lnet_exit); diff --git a/lnet/selftest/module.c b/lnet/selftest/module.c index 188006a..770c92c 100644 --- a/lnet/selftest/module.c +++ b/lnet/selftest/module.c @@ -54,7 +54,7 @@ struct cfs_wi_sched *lst_sched_serial; struct cfs_wi_sched **lst_sched_test; static void -lnet_selftest_fini(void) +lnet_selftest_exit(void) { int i; @@ -99,7 +99,7 @@ lnet_selftest_structure_assertion(void) CLASSERT(sizeof(srpc_stat_reqst_t) == 28); } -static int +static int __init lnet_selftest_init(void) { int nscheds; @@ -156,14 +156,14 @@ lnet_selftest_init(void) lst_init_step = LST_INIT_CONSOLE; return 0; error: - lnet_selftest_fini(); + lnet_selftest_exit(); return rc; } - +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("LNet Selftest"); -MODULE_VERSION("0.9.0"); +MODULE_VERSION("2.8.0"); MODULE_LICENSE("GPL"); module_init(lnet_selftest_init); -module_exit(lnet_selftest_fini); +module_exit(lnet_selftest_exit); diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index 5fb5b64..f935f8e 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -568,7 +568,7 @@ EXPORT_SYMBOL(client_fid_fini); struct proc_dir_entry *seq_type_proc_dir; -static int __init fid_mod_init(void) +static int __init fid_init(void) { seq_type_proc_dir = lprocfs_register(LUSTRE_SEQ_NAME, proc_lustre_root, @@ -583,7 +583,7 @@ static int __init fid_mod_init(void) return 0; } -static void __exit fid_mod_exit(void) +static void __exit fid_exit(void) { # ifdef HAVE_SERVER_SUPPORT fid_server_mod_exit(); @@ -596,9 +596,9 @@ static void __exit fid_mod_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre FID Module"); +MODULE_DESCRIPTION("Lustre File IDentifier"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(fid_mod_init); -module_exit(fid_mod_exit); +module_init(fid_init); +module_exit(fid_exit); diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index de6c96a..21ce719 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -527,7 +527,7 @@ void fld_client_flush(struct lu_client_fld *fld) struct proc_dir_entry *fld_type_proc_dir; -static int __init fld_mod_init(void) +static int __init fld_init(void) { fld_type_proc_dir = lprocfs_register(LUSTRE_FLD_NAME, proc_lustre_root, @@ -542,7 +542,7 @@ static int __init fld_mod_init(void) return 0; } -static void __exit fld_mod_exit(void) +static void __exit fld_exit(void) { #ifdef HAVE_SERVER_SUPPORT fld_server_mod_exit(); @@ -555,9 +555,9 @@ static void __exit fld_mod_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre FLD"); +MODULE_DESCRIPTION("Lustre FID Location Database"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(fld_mod_init); -module_exit(fld_mod_exit); +module_init(fld_init); +module_exit(fld_exit); diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c index ed2a3d8..b7bb529 100644 --- a/lustre/lfsck/lfsck_lib.c +++ b/lustre/lfsck/lfsck_lib.c @@ -3592,7 +3592,7 @@ static void __exit lfsck_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("LFSCK"); +MODULE_DESCRIPTION("Lustre File System Checker"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c index 48ff50b..3bf9bf4 100644 --- a/lustre/llite/lloop.c +++ b/lustre/llite/lloop.c @@ -894,27 +894,27 @@ out_mem1: return -ENOMEM; } -static void lloop_exit(void) +static void __exit lloop_exit(void) { - int i; + int i; - ll_iocontrol_unregister(ll_iocontrol_magic); - for (i = 0; i < max_loop; i++) { - del_gendisk(disks[i]); - blk_cleanup_queue(loop_dev[i].lo_queue); - put_disk(disks[i]); - } + ll_iocontrol_unregister(ll_iocontrol_magic); + for (i = 0; i < max_loop; i++) { + del_gendisk(disks[i]); + blk_cleanup_queue(loop_dev[i].lo_queue); + put_disk(disks[i]); + } unregister_blkdev(lloop_major, "lloop"); - OBD_FREE(disks, max_loop * sizeof(*disks)); - OBD_FREE(loop_dev, max_loop * sizeof(*loop_dev)); + OBD_FREE(disks, max_loop * sizeof(*disks)); + OBD_FREE(loop_dev, max_loop * sizeof(*loop_dev)); } -module_init(lloop_init); -module_exit(lloop_exit); - CFS_MODULE_PARM(max_loop, "i", int, 0444, "maximum of lloop_device"); MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre virtual block device"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); + +module_init(lloop_init); +module_exit(lloop_exit); diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index 4f1c2df..71ac616 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -102,7 +102,7 @@ struct super_operations lustre_super_operations = void lustre_register_client_process_config(int (*cpc)(struct lustre_cfg *lcfg)); -static int __init init_lustre_lite(void) +static int __init lustre_init(void) { struct proc_dir_entry *entry; lnet_process_id_t lnet_id; @@ -210,7 +210,7 @@ out_cache: return rc; } -static void __exit exit_lustre_lite(void) +static void __exit lustre_exit(void) { lustre_register_client_fill_super(NULL); lustre_register_kill_super_cb(NULL); @@ -229,9 +229,9 @@ static void __exit exit_lustre_lite(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Lite Client File System"); +MODULE_DESCRIPTION("Lustre Client File System"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(init_lustre_lite); -module_exit(exit_lustre_lite); +module_init(lustre_init); +module_exit(lustre_exit); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index ba8e408..6ad6aba 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -3397,19 +3397,19 @@ struct md_ops lmv_md_ops = { .m_unpackmd = lmv_unpackmd, }; -int __init lmv_init(void) +static int __init lmv_init(void) { return class_register_type(&lmv_obd_ops, &lmv_md_ops, true, NULL, LUSTRE_LMV_NAME, NULL); } -static void lmv_exit(void) +static void __exit lmv_exit(void) { - class_unregister_type(LUSTRE_LMV_NAME); + class_unregister_type(LUSTRE_LMV_NAME); } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Logical Metadata Volume OBD driver"); +MODULE_DESCRIPTION("Lustre Logical Metadata Volume"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index be0dfbf..e2ceba6 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -1918,7 +1918,7 @@ static struct obd_ops lod_obd_device_ops = { .o_pool_del = lod_pool_del, }; -static int __init lod_mod_init(void) +static int __init lod_init(void) { struct obd_type *type; int rc; @@ -1950,7 +1950,7 @@ static int __init lod_mod_init(void) return rc; } -static void __exit lod_mod_exit(void) +static void __exit lod_exit(void) { class_unregister_type(LUSTRE_LOD_NAME); lu_kmem_fini(lod_caches); @@ -1961,6 +1961,5 @@ MODULE_DESCRIPTION("Lustre Logical Object Device ("LUSTRE_LOD_NAME")"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(lod_mod_init); -module_exit(lod_mod_exit); - +module_init(lod_init); +module_exit(lod_exit); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 4c6cc9f..5cff89f 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -1497,7 +1497,7 @@ static int __init lov_init(void) RETURN(rc); } -static void /*__exit*/ lov_exit(void) +static void __exit lov_exit(void) { class_unregister_type(LUSTRE_LOV_NAME); kmem_cache_destroy(lov_oinfo_slab); @@ -1505,7 +1505,7 @@ static void /*__exit*/ lov_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Logical Object Volume OBD driver"); +MODULE_DESCRIPTION("Lustre Logical Object Volume"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 1a1e038..b2227d8 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -2789,7 +2789,7 @@ static int __init mdc_init(void) LUSTRE_MDC_NAME, NULL); } -static void /*__exit*/ mdc_exit(void) +static void __exit mdc_exit(void) { class_unregister_type(LUSTRE_MDC_NAME); } diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index b3b9d96..74ab352 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -1584,7 +1584,7 @@ void mdd_generic_thread_stop(struct mdd_generic_thread *thread) } } -static int __init mdd_mod_init(void) +static int __init mdd_init(void) { int rc; @@ -1608,16 +1608,16 @@ static int __init mdd_mod_init(void) return rc; } -static void __exit mdd_mod_exit(void) +static void __exit mdd_exit(void) { class_unregister_type(LUSTRE_MDD_NAME); lu_kmem_fini(mdd_caches); } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Meta-data Device Prototype ("LUSTRE_MDD_NAME")"); +MODULE_DESCRIPTION("Lustre Meta-data Device Driver ("LUSTRE_MDD_NAME")"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(mdd_mod_init); -module_exit(mdd_mod_exit); +module_init(mdd_init); +module_exit(mdd_exit); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index ef4eeda..842f50d 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -5836,7 +5836,7 @@ static struct lu_device_type mdt_device_type = { .ldt_ctx_tags = LCT_MD_THREAD }; -static int __init mdt_mod_init(void) +static int __init mdt_init(void) { int rc; @@ -5865,7 +5865,7 @@ mds_fini: return rc; } -static void __exit mdt_mod_exit(void) +static void __exit mdt_exit(void) { class_unregister_type(LUSTRE_MDT_NAME); mds_mod_exit(); @@ -5877,5 +5877,5 @@ MODULE_DESCRIPTION("Lustre Metadata Target ("LUSTRE_MDT_NAME")"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(mdt_mod_init); -module_exit(mdt_mod_exit); +module_init(mdt_init); +module_exit(mdt_exit); diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 5dfb761..ba1a2e1 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -2134,7 +2134,7 @@ static int __init mgc_init(void) LUSTRE_MGC_NAME, NULL); } -static void /*__exit*/ mgc_exit(void) +static void __exit mgc_exit(void) { class_unregister_type(LUSTRE_MGC_NAME); } diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 0a1f9d5..17cb290 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -1545,13 +1545,13 @@ static int __init mgs_init(void) LUSTRE_MGS_NAME, &mgs_device_type); } -static void /*__exit*/ mgs_exit(void) +static void __exit mgs_exit(void) { class_unregister_type(LUSTRE_MGS_NAME); } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Management Server (MGS)"); +MODULE_DESCRIPTION("Lustre Management Server (MGS)"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 272c564..b742b51 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -492,7 +492,7 @@ static int obd_init_checks(void) #define obd_init_checks() do {} while(0) #endif -static int __init init_obdclass(void) +static int __init obdclass_init(void) { int i, err; @@ -607,9 +607,7 @@ __u64 obd_memory_max(void) } #endif /* CONFIG_PROC_FS */ -/* liblustre doesn't call cleanup_obdclass, apparently. we carry on in this - * ifdef to the end of the file to cover module and versioning goo.*/ -static void cleanup_obdclass(void) +static void __exit obdclass_exit(void) { __u64 memory_leaked; __u64 memory_max; @@ -649,9 +647,9 @@ static void cleanup_obdclass(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION); +MODULE_DESCRIPTION("Lustre Class Driver"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(init_obdclass); -module_exit(cleanup_obdclass); +module_init(obdclass_init); +module_exit(obdclass_exit); diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index 78387b2..3629397 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -1993,7 +1993,7 @@ static void __exit llog_test_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("llog test module"); +MODULE_DESCRIPTION("Lustre Log test module"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 7b0cb7f..f936795 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -2888,27 +2888,6 @@ static struct obd_ops echo_client_obd_ops = { .o_disconnect = echo_client_disconnect }; -static int echo_client_init(void) -{ - int rc; - - rc = lu_kmem_init(echo_caches); - if (rc == 0) { - rc = class_register_type(&echo_client_obd_ops, NULL, true, NULL, - LUSTRE_ECHO_CLIENT_NAME, - &echo_device_type); - if (rc) - lu_kmem_fini(echo_caches); - } - return rc; -} - -static void echo_client_exit(void) -{ - class_unregister_type(LUSTRE_ECHO_CLIENT_NAME); - lu_kmem_fini(echo_caches); -} - static int __init obdecho_init(void) { int rc; @@ -2929,7 +2908,14 @@ static int __init obdecho_init(void) goto failed_1; # endif - rc = echo_client_init(); + rc = lu_kmem_init(echo_caches); + if (rc == 0) { + rc = class_register_type(&echo_client_obd_ops, NULL, true, NULL, + LUSTRE_ECHO_CLIENT_NAME, + &echo_device_type); + if (rc) + lu_kmem_fini(echo_caches); + } # ifdef HAVE_SERVER_SUPPORT if (rc == 0) @@ -2943,18 +2929,19 @@ failed_0: RETURN(rc); } -static void /*__exit*/ obdecho_exit(void) +static void __exit obdecho_exit(void) { - echo_client_exit(); + class_unregister_type(LUSTRE_ECHO_CLIENT_NAME); + lu_kmem_fini(echo_caches); -# ifdef HAVE_SERVER_SUPPORT - class_unregister_type(LUSTRE_ECHO_NAME); - echo_persistent_pages_fini(); -# endif +#ifdef HAVE_SERVER_SUPPORT + class_unregister_type(LUSTRE_ECHO_NAME); + echo_persistent_pages_fini(); +#endif } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Testing Echo OBD driver"); +MODULE_DESCRIPTION("Lustre Echo Client test driver"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index b1ade56..ee7d04a 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2899,7 +2899,7 @@ out: RETURN(rc); } -static void /*__exit*/ osc_exit(void) +static void __exit osc_exit(void) { remove_shrinker(osc_cache_shrinker); class_unregister_type(LUSTRE_OSC_NAME); diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index e3de52a..0369122 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -6437,7 +6437,7 @@ static struct obd_ops osd_obd_device_ops = { .o_health_check = osd_health_check, }; -static int __init osd_mod_init(void) +static int __init osd_init(void) { int rc; @@ -6461,7 +6461,7 @@ static int __init osd_mod_init(void) return rc; } -static void __exit osd_mod_exit(void) +static void __exit osd_exit(void) { class_unregister_type(LUSTRE_OSD_LDISKFS_NAME); lu_kmem_fini(ldiskfs_caches); @@ -6472,5 +6472,5 @@ MODULE_DESCRIPTION("Lustre Object Storage Device ("LUSTRE_OSD_LDISKFS_NAME")"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(osd_mod_init); -module_exit(osd_mod_exit); +module_init(osd_init); +module_exit(osd_exit); diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 556c875..6fc37d5 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -1356,7 +1356,7 @@ static struct obd_ops osd_obd_device_ops = { .o_fid_alloc = osd_fid_alloc }; -int __init osd_init(void) +static int __init osd_init(void) { int rc; @@ -1375,7 +1375,7 @@ int __init osd_init(void) return rc; } -void __exit osd_exit(void) +static void __exit osd_exit(void) { class_unregister_type(LUSTRE_OSD_ZFS_NAME); lu_kmem_fini(osd_caches); diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index d85bbbe..e4af6b6 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -1900,7 +1900,7 @@ struct llog_operations osp_mds_ost_orig_logops; * \retval 0 0 if initialization succeeds. * \retval negative negative errno if initialization failed. */ -static int __init osp_mod_init(void) +static int __init osp_init(void) { struct obd_type *type; int rc; @@ -1952,7 +1952,7 @@ static int __init osp_mod_init(void) * This callback is called when kernel unloads OSP module from memory, and * it will deregister OSP and LWP device type from obd_types (\see class_obd.c). */ -static void __exit osp_mod_exit(void) +static void __exit osp_exit(void) { class_unregister_type(LUSTRE_LWP_NAME); class_unregister_type(LUSTRE_OSP_NAME); @@ -1960,9 +1960,9 @@ static void __exit osp_mod_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre OST Proxy Device ("LUSTRE_OSP_NAME")"); +MODULE_DESCRIPTION("Lustre OSD Storage Proxy ("LUSTRE_OSP_NAME")"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(osp_mod_init); -module_exit(osp_mod_exit); +module_init(osp_init); +module_exit(osp_exit); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 48b6f37..4878bf2 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -428,13 +428,13 @@ static int __init ost_init(void) RETURN(rc); } -static void /*__exit*/ ost_exit(void) +static void __exit ost_exit(void) { class_unregister_type(LUSTRE_OSS_NAME); } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("Lustre Object Storage Target (OST) v0.01"); +MODULE_DESCRIPTION("Lustre Object Storage Target (OST)"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/ptlrpc/gss/sec_gss.c b/lustre/ptlrpc/gss/sec_gss.c index c493dbb..b5f038b 100644 --- a/lustre/ptlrpc/gss/sec_gss.c +++ b/lustre/ptlrpc/gss/sec_gss.c @@ -2869,7 +2869,7 @@ static void gss_init_at_reply_offset(void) gss_at_reply_off_priv = lustre_msg_size_v2(3, buflens); } -int __init sptlrpc_gss_init(void) +static int __init sptlrpc_gss_init(void) { int rc; @@ -2940,7 +2940,7 @@ static void __exit sptlrpc_gss_exit(void) } MODULE_AUTHOR("OpenSFS, Inc. "); -MODULE_DESCRIPTION("GSS security policy for Lustre"); +MODULE_DESCRIPTION("Lustre GSS security policy"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); diff --git a/lustre/quota/lquota_lib.c b/lustre/quota/lquota_lib.c index 9f3f324..b7eea3d 100644 --- a/lustre/quota/lquota_lib.c +++ b/lustre/quota/lquota_lib.c @@ -289,7 +289,7 @@ int lquota_extract_fid(const struct lu_fid *fid, int *pool_id, int *pool_type, RETURN(0); } -static int __init init_lquota(void) +static int __init lquota_init(void) { int rc; ENTRY; @@ -320,7 +320,7 @@ out_key: return rc; } -static void exit_lquota(void) +static void __exit lquota_exit(void) { qsd_glb_fini(); qmt_glb_fini(); @@ -333,5 +333,5 @@ MODULE_DESCRIPTION("Lustre Quota"); MODULE_VERSION(LUSTRE_VERSION_STRING); MODULE_LICENSE("GPL"); -module_init(init_lquota); -module_exit(exit_lquota); +module_init(lquota_init); +module_exit(lquota_exit); -- 1.8.3.1