diff options
author | Chengguang Xu <cgxu519@gmx.com> | 2018-03-10 07:32:05 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-04-02 04:12:48 -0400 |
commit | 57a35dfb522c8bbac622d49f5217906f9b5eceb0 (patch) | |
tree | 8c302951e78d39790a7417cebcc5f27ba10f25a6 | |
parent | 51b10f3fe446f536b6edf90ce6941882033dd93b (diff) |
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: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r-- | fs/ceph/cache.c | 2 | ||||
-rw-r--r-- | net/ceph/crypto.c | 6 | ||||
-rw-r--r-- | net/ceph/debugfs.c | 7 | ||||
-rw-r--r-- | net/ceph/messenger.c | 4 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 4 |
5 files changed, 9 insertions, 14 deletions
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index 3781f723ff31..797cc8160199 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c | |||
@@ -71,7 +71,7 @@ static const struct fscache_cookie_def ceph_fscache_fsid_object_def = { | |||
71 | .get_key = ceph_fscache_session_get_key, | 71 | .get_key = ceph_fscache_session_get_key, |
72 | }; | 72 | }; |
73 | 73 | ||
74 | int ceph_fscache_register(void) | 74 | int __init ceph_fscache_register(void) |
75 | { | 75 | { |
76 | return fscache_register_netfs(&ceph_cache_netfs); | 76 | return fscache_register_netfs(&ceph_cache_netfs); |
77 | } | 77 | } |
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index bf9d079cbafd..02172c408ff2 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c | |||
@@ -347,10 +347,12 @@ struct key_type key_type_ceph = { | |||
347 | .destroy = ceph_key_destroy, | 347 | .destroy = ceph_key_destroy, |
348 | }; | 348 | }; |
349 | 349 | ||
350 | int ceph_crypto_init(void) { | 350 | int __init ceph_crypto_init(void) |
351 | { | ||
351 | return register_key_type(&key_type_ceph); | 352 | return register_key_type(&key_type_ceph); |
352 | } | 353 | } |
353 | 354 | ||
354 | void ceph_crypto_shutdown(void) { | 355 | void ceph_crypto_shutdown(void) |
356 | { | ||
355 | unregister_key_type(&key_type_ceph); | 357 | unregister_key_type(&key_type_ceph); |
356 | } | 358 | } |
diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c index 0ef0f32a4570..02952605d121 100644 --- a/net/ceph/debugfs.c +++ b/net/ceph/debugfs.c | |||
@@ -389,7 +389,7 @@ CEPH_DEFINE_SHOW_FUNC(monc_show) | |||
389 | CEPH_DEFINE_SHOW_FUNC(osdc_show) | 389 | CEPH_DEFINE_SHOW_FUNC(osdc_show) |
390 | CEPH_DEFINE_SHOW_FUNC(client_options_show) | 390 | CEPH_DEFINE_SHOW_FUNC(client_options_show) |
391 | 391 | ||
392 | int ceph_debugfs_init(void) | 392 | int __init ceph_debugfs_init(void) |
393 | { | 393 | { |
394 | ceph_debugfs_dir = debugfs_create_dir("ceph", NULL); | 394 | ceph_debugfs_dir = debugfs_create_dir("ceph", NULL); |
395 | if (!ceph_debugfs_dir) | 395 | if (!ceph_debugfs_dir) |
@@ -477,7 +477,7 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client) | |||
477 | 477 | ||
478 | #else /* CONFIG_DEBUG_FS */ | 478 | #else /* CONFIG_DEBUG_FS */ |
479 | 479 | ||
480 | int ceph_debugfs_init(void) | 480 | int __init ceph_debugfs_init(void) |
481 | { | 481 | { |
482 | return 0; | 482 | return 0; |
483 | } | 483 | } |
@@ -496,6 +496,3 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client) | |||
496 | } | 496 | } |
497 | 497 | ||
498 | #endif /* CONFIG_DEBUG_FS */ | 498 | #endif /* CONFIG_DEBUG_FS */ |
499 | |||
500 | EXPORT_SYMBOL(ceph_debugfs_init); | ||
501 | EXPORT_SYMBOL(ceph_debugfs_cleanup); | ||
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index cee4b3d307de..fcb40c12b1f8 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -277,7 +277,7 @@ static void _ceph_msgr_exit(void) | |||
277 | ceph_msgr_slab_exit(); | 277 | ceph_msgr_slab_exit(); |
278 | } | 278 | } |
279 | 279 | ||
280 | int ceph_msgr_init(void) | 280 | int __init ceph_msgr_init(void) |
281 | { | 281 | { |
282 | if (ceph_msgr_slab_init()) | 282 | if (ceph_msgr_slab_init()) |
283 | return -ENOMEM; | 283 | return -ENOMEM; |
@@ -299,7 +299,6 @@ int ceph_msgr_init(void) | |||
299 | 299 | ||
300 | return -ENOMEM; | 300 | return -ENOMEM; |
301 | } | 301 | } |
302 | EXPORT_SYMBOL(ceph_msgr_init); | ||
303 | 302 | ||
304 | void ceph_msgr_exit(void) | 303 | void ceph_msgr_exit(void) |
305 | { | 304 | { |
@@ -307,7 +306,6 @@ void ceph_msgr_exit(void) | |||
307 | 306 | ||
308 | _ceph_msgr_exit(); | 307 | _ceph_msgr_exit(); |
309 | } | 308 | } |
310 | EXPORT_SYMBOL(ceph_msgr_exit); | ||
311 | 309 | ||
312 | void ceph_msgr_flush(void) | 310 | void ceph_msgr_flush(void) |
313 | { | 311 | { |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 4a3af96dc057..ea2a6c9fb7ce 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -5106,7 +5106,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, | |||
5106 | } | 5106 | } |
5107 | EXPORT_SYMBOL(ceph_osdc_writepages); | 5107 | EXPORT_SYMBOL(ceph_osdc_writepages); |
5108 | 5108 | ||
5109 | int ceph_osdc_setup(void) | 5109 | int __init ceph_osdc_setup(void) |
5110 | { | 5110 | { |
5111 | size_t size = sizeof(struct ceph_osd_request) + | 5111 | size_t size = sizeof(struct ceph_osd_request) + |
5112 | CEPH_OSD_SLAB_OPS * sizeof(struct ceph_osd_req_op); | 5112 | CEPH_OSD_SLAB_OPS * sizeof(struct ceph_osd_req_op); |
@@ -5117,7 +5117,6 @@ int ceph_osdc_setup(void) | |||
5117 | 5117 | ||
5118 | return ceph_osd_request_cache ? 0 : -ENOMEM; | 5118 | return ceph_osd_request_cache ? 0 : -ENOMEM; |
5119 | } | 5119 | } |
5120 | EXPORT_SYMBOL(ceph_osdc_setup); | ||
5121 | 5120 | ||
5122 | void ceph_osdc_cleanup(void) | 5121 | void ceph_osdc_cleanup(void) |
5123 | { | 5122 | { |
@@ -5125,7 +5124,6 @@ void ceph_osdc_cleanup(void) | |||
5125 | kmem_cache_destroy(ceph_osd_request_cache); | 5124 | kmem_cache_destroy(ceph_osd_request_cache); |
5126 | ceph_osd_request_cache = NULL; | 5125 | ceph_osd_request_cache = NULL; |
5127 | } | 5126 | } |
5128 | EXPORT_SYMBOL(ceph_osdc_cleanup); | ||
5129 | 5127 | ||
5130 | /* | 5128 | /* |
5131 | * handle incoming message | 5129 | * handle incoming message |