The __init and __exit attributes appear to have been over used for
the ptlrpc module. They should only be attached to ptlrpc_init and
ptlrpc_exit respectively and those functions should call the required
cleanup functions. By using the attributes too broadly the following
section mismatch warning with be hit. This indentifies cases where
your calling an __exit function from an __init function which is in
the wrong section.
WARNING: ~/src/git/lustre/lustre/ptlrpc/ptlrpc.o(.init.text+0x354):
Section mismatch in reference from the function ptlrpc_init() to the
function .exit.text:sptlrpc_fini() The function __init ptlrpc_init()
references a function __exit sptlrpc_fini().
This is often seen when error handling in the init function uses
functionality in the exit path. The fix is often to remove the
__exit annotation of sptlrpc_fini() so it may be used outside an
exit section.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I94a4cb5fb7deea41fce5ee939470dc2e40908f98
Reviewed-on: http://review.whamcloud.com/1653
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
RETURN(0);
}
-int __init ldlm_init(void)
+int ldlm_init(void)
{
cfs_init_mutex(&ldlm_ref_sem);
cfs_init_mutex(ldlm_namespace_lock(LDLM_NAMESPACE_SERVER));
return 0;
}
-void __exit ldlm_exit(void)
+void ldlm_exit(void)
{
int rc;
if (ldlm_refcount)
void sptlrpc_conf_fini(void);
/* sec.c */
-int __init sptlrpc_init(void);
-void __exit sptlrpc_fini(void);
+int sptlrpc_init(void);
+void sptlrpc_fini(void);
/* recov_thread.c */
int llog_recov_init(void);
* initialize/finalize *
****************************************/
-int __init sptlrpc_init(void)
+int sptlrpc_init(void)
{
int rc;
return rc;
}
-void __exit sptlrpc_fini(void)
+void sptlrpc_fini(void)
{
sptlrpc_lproc_fini();
sptlrpc_plain_fini();