提交 57a35dfb 编写于 作者: C Chengguang Xu 提交者: Ilya Dryomov

libceph, ceph: add __init attribution to init funcitons

Add __init attribution to the functions which are called only once
during initiating/registering operations and deleting unnecessary
symbol exports.
Signed-off-by: NChengguang Xu <cgxu519@gmx.com>
Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
上级 51b10f3f
...@@ -71,7 +71,7 @@ static const struct fscache_cookie_def ceph_fscache_fsid_object_def = { ...@@ -71,7 +71,7 @@ static const struct fscache_cookie_def ceph_fscache_fsid_object_def = {
.get_key = ceph_fscache_session_get_key, .get_key = ceph_fscache_session_get_key,
}; };
int ceph_fscache_register(void) int __init ceph_fscache_register(void)
{ {
return fscache_register_netfs(&ceph_cache_netfs); return fscache_register_netfs(&ceph_cache_netfs);
} }
......
...@@ -347,10 +347,12 @@ struct key_type key_type_ceph = { ...@@ -347,10 +347,12 @@ struct key_type key_type_ceph = {
.destroy = ceph_key_destroy, .destroy = ceph_key_destroy,
}; };
int ceph_crypto_init(void) { int __init ceph_crypto_init(void)
{
return register_key_type(&key_type_ceph); return register_key_type(&key_type_ceph);
} }
void ceph_crypto_shutdown(void) { void ceph_crypto_shutdown(void)
{
unregister_key_type(&key_type_ceph); unregister_key_type(&key_type_ceph);
} }
...@@ -389,7 +389,7 @@ CEPH_DEFINE_SHOW_FUNC(monc_show) ...@@ -389,7 +389,7 @@ CEPH_DEFINE_SHOW_FUNC(monc_show)
CEPH_DEFINE_SHOW_FUNC(osdc_show) CEPH_DEFINE_SHOW_FUNC(osdc_show)
CEPH_DEFINE_SHOW_FUNC(client_options_show) CEPH_DEFINE_SHOW_FUNC(client_options_show)
int ceph_debugfs_init(void) int __init ceph_debugfs_init(void)
{ {
ceph_debugfs_dir = debugfs_create_dir("ceph", NULL); ceph_debugfs_dir = debugfs_create_dir("ceph", NULL);
if (!ceph_debugfs_dir) if (!ceph_debugfs_dir)
...@@ -477,7 +477,7 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client) ...@@ -477,7 +477,7 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
#else /* CONFIG_DEBUG_FS */ #else /* CONFIG_DEBUG_FS */
int ceph_debugfs_init(void) int __init ceph_debugfs_init(void)
{ {
return 0; return 0;
} }
...@@ -496,6 +496,3 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client) ...@@ -496,6 +496,3 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
} }
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
EXPORT_SYMBOL(ceph_debugfs_init);
EXPORT_SYMBOL(ceph_debugfs_cleanup);
...@@ -277,7 +277,7 @@ static void _ceph_msgr_exit(void) ...@@ -277,7 +277,7 @@ static void _ceph_msgr_exit(void)
ceph_msgr_slab_exit(); ceph_msgr_slab_exit();
} }
int ceph_msgr_init(void) int __init ceph_msgr_init(void)
{ {
if (ceph_msgr_slab_init()) if (ceph_msgr_slab_init())
return -ENOMEM; return -ENOMEM;
...@@ -299,7 +299,6 @@ int ceph_msgr_init(void) ...@@ -299,7 +299,6 @@ int ceph_msgr_init(void)
return -ENOMEM; return -ENOMEM;
} }
EXPORT_SYMBOL(ceph_msgr_init);
void ceph_msgr_exit(void) void ceph_msgr_exit(void)
{ {
...@@ -307,7 +306,6 @@ void ceph_msgr_exit(void) ...@@ -307,7 +306,6 @@ void ceph_msgr_exit(void)
_ceph_msgr_exit(); _ceph_msgr_exit();
} }
EXPORT_SYMBOL(ceph_msgr_exit);
void ceph_msgr_flush(void) void ceph_msgr_flush(void)
{ {
......
...@@ -5106,7 +5106,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, ...@@ -5106,7 +5106,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
} }
EXPORT_SYMBOL(ceph_osdc_writepages); EXPORT_SYMBOL(ceph_osdc_writepages);
int ceph_osdc_setup(void) int __init ceph_osdc_setup(void)
{ {
size_t size = sizeof(struct ceph_osd_request) + size_t size = sizeof(struct ceph_osd_request) +
CEPH_OSD_SLAB_OPS * sizeof(struct ceph_osd_req_op); CEPH_OSD_SLAB_OPS * sizeof(struct ceph_osd_req_op);
...@@ -5117,7 +5117,6 @@ int ceph_osdc_setup(void) ...@@ -5117,7 +5117,6 @@ int ceph_osdc_setup(void)
return ceph_osd_request_cache ? 0 : -ENOMEM; return ceph_osd_request_cache ? 0 : -ENOMEM;
} }
EXPORT_SYMBOL(ceph_osdc_setup);
void ceph_osdc_cleanup(void) void ceph_osdc_cleanup(void)
{ {
...@@ -5125,7 +5124,6 @@ void ceph_osdc_cleanup(void) ...@@ -5125,7 +5124,6 @@ void ceph_osdc_cleanup(void)
kmem_cache_destroy(ceph_osd_request_cache); kmem_cache_destroy(ceph_osd_request_cache);
ceph_osd_request_cache = NULL; ceph_osd_request_cache = NULL;
} }
EXPORT_SYMBOL(ceph_osdc_cleanup);
/* /*
* handle incoming message * handle incoming message
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册