]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
libceph, ceph: add __init attribution to init funcitons
authorChengguang Xu <cgxu519@gmx.com>
Sat, 10 Mar 2018 12:32:05 +0000 (20:32 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 2 Apr 2018 08:12:48 +0000 (10:12 +0200)
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>
fs/ceph/cache.c
net/ceph/crypto.c
net/ceph/debugfs.c
net/ceph/messenger.c
net/ceph/osd_client.c

index 3781f723ff31ffedf1fdf65984f8b5c6b554467b..797cc816019903a75fa6eb57e510070761b1ca37 100644 (file)
@@ -71,7 +71,7 @@ static const struct fscache_cookie_def ceph_fscache_fsid_object_def = {
        .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);
 }
index bf9d079cbafd6e89d56ef5f10d81727bd5cbd42b..02172c408ff28d81a23da4cd7aea12025293611d 100644 (file)
@@ -347,10 +347,12 @@ struct key_type key_type_ceph = {
        .destroy        = ceph_key_destroy,
 };
 
-int ceph_crypto_init(void) {
+int __init ceph_crypto_init(void)
+{
        return register_key_type(&key_type_ceph);
 }
 
-void ceph_crypto_shutdown(void) {
+void ceph_crypto_shutdown(void)
+{
        unregister_key_type(&key_type_ceph);
 }
index 0ef0f32a4570f98de3ae67a79fe2927d6754db55..02952605d121871200d437d13a832241b3beb5a4 100644 (file)
@@ -389,7 +389,7 @@ CEPH_DEFINE_SHOW_FUNC(monc_show)
 CEPH_DEFINE_SHOW_FUNC(osdc_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);
        if (!ceph_debugfs_dir)
@@ -477,7 +477,7 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
 
 #else  /* CONFIG_DEBUG_FS */
 
-int ceph_debugfs_init(void)
+int __init ceph_debugfs_init(void)
 {
        return 0;
 }
@@ -496,6 +496,3 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
 }
 
 #endif  /* CONFIG_DEBUG_FS */
-
-EXPORT_SYMBOL(ceph_debugfs_init);
-EXPORT_SYMBOL(ceph_debugfs_cleanup);
index cee4b3d307deb8aaa590689047428062a2dfb7d3..fcb40c12b1f838e24b2f2a1a58b632522acab8b4 100644 (file)
@@ -277,7 +277,7 @@ static void _ceph_msgr_exit(void)
        ceph_msgr_slab_exit();
 }
 
-int ceph_msgr_init(void)
+int __init ceph_msgr_init(void)
 {
        if (ceph_msgr_slab_init())
                return -ENOMEM;
@@ -299,7 +299,6 @@ int ceph_msgr_init(void)
 
        return -ENOMEM;
 }
-EXPORT_SYMBOL(ceph_msgr_init);
 
 void ceph_msgr_exit(void)
 {
@@ -307,7 +306,6 @@ void ceph_msgr_exit(void)
 
        _ceph_msgr_exit();
 }
-EXPORT_SYMBOL(ceph_msgr_exit);
 
 void ceph_msgr_flush(void)
 {
index 4a3af96dc0574fee373bff7460734ea625f81f65..ea2a6c9fb7cef01b54eb86a1a7c580625feb4b1e 100644 (file)
@@ -5106,7 +5106,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
 }
 EXPORT_SYMBOL(ceph_osdc_writepages);
 
-int ceph_osdc_setup(void)
+int __init ceph_osdc_setup(void)
 {
        size_t size = sizeof(struct ceph_osd_request) +
            CEPH_OSD_SLAB_OPS * sizeof(struct ceph_osd_req_op);
@@ -5117,7 +5117,6 @@ int ceph_osdc_setup(void)
 
        return ceph_osd_request_cache ? 0 : -ENOMEM;
 }
-EXPORT_SYMBOL(ceph_osdc_setup);
 
 void ceph_osdc_cleanup(void)
 {
@@ -5125,7 +5124,6 @@ void ceph_osdc_cleanup(void)
        kmem_cache_destroy(ceph_osd_request_cache);
        ceph_osd_request_cache = NULL;
 }
-EXPORT_SYMBOL(ceph_osdc_cleanup);
 
 /*
  * handle incoming message