Skip to content

Commit 57a35df

Browse files
Chengguang Xuidryomov
authored andcommitted
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>
1 parent 51b10f3 commit 57a35df

5 files changed

Lines changed: 9 additions & 14 deletions

File tree

‎fs/ceph/cache.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static const struct fscache_cookie_def ceph_fscache_fsid_object_def = {
7171
.get_key = ceph_fscache_session_get_key,
7272
};
7373

74-
int ceph_fscache_register(void)
74+
int __init ceph_fscache_register(void)
7575
{
7676
return fscache_register_netfs(&ceph_cache_netfs);
7777
}

‎net/ceph/crypto.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,12 @@ struct key_type key_type_ceph = {
347347
.destroy = ceph_key_destroy,
348348
};
349349

350-
int ceph_crypto_init(void) {
350+
int __init ceph_crypto_init(void)
351+
{
351352
return register_key_type(&key_type_ceph);
352353
}
353354

354-
void ceph_crypto_shutdown(void) {
355+
void ceph_crypto_shutdown(void)
356+
{
355357
unregister_key_type(&key_type_ceph);
356358
}

‎net/ceph/debugfs.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ CEPH_DEFINE_SHOW_FUNC(monc_show)
389389
CEPH_DEFINE_SHOW_FUNC(osdc_show)
390390
CEPH_DEFINE_SHOW_FUNC(client_options_show)
391391

392-
int ceph_debugfs_init(void)
392+
int __init ceph_debugfs_init(void)
393393
{
394394
ceph_debugfs_dir = debugfs_create_dir("ceph", NULL);
395395
if (!ceph_debugfs_dir)
@@ -477,7 +477,7 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
477477

478478
#else /* CONFIG_DEBUG_FS */
479479

480-
int ceph_debugfs_init(void)
480+
int __init ceph_debugfs_init(void)
481481
{
482482
return 0;
483483
}
@@ -496,6 +496,3 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
496496
}
497497

498498
#endif /* CONFIG_DEBUG_FS */
499-
500-
EXPORT_SYMBOL(ceph_debugfs_init);
501-
EXPORT_SYMBOL(ceph_debugfs_cleanup);

‎net/ceph/messenger.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static void _ceph_msgr_exit(void)
277277
ceph_msgr_slab_exit();
278278
}
279279

280-
int ceph_msgr_init(void)
280+
int __init ceph_msgr_init(void)
281281
{
282282
if (ceph_msgr_slab_init())
283283
return -ENOMEM;
@@ -299,15 +299,13 @@ int ceph_msgr_init(void)
299299

300300
return -ENOMEM;
301301
}
302-
EXPORT_SYMBOL(ceph_msgr_init);
303302

304303
void ceph_msgr_exit(void)
305304
{
306305
BUG_ON(ceph_msgr_wq == NULL);
307306

308307
_ceph_msgr_exit();
309308
}
310-
EXPORT_SYMBOL(ceph_msgr_exit);
311309

312310
void ceph_msgr_flush(void)
313311
{

‎net/ceph/osd_client.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5106,7 +5106,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
51065106
}
51075107
EXPORT_SYMBOL(ceph_osdc_writepages);
51085108

5109-
int ceph_osdc_setup(void)
5109+
int __init ceph_osdc_setup(void)
51105110
{
51115111
size_t size = sizeof(struct ceph_osd_request) +
51125112
CEPH_OSD_SLAB_OPS * sizeof(struct ceph_osd_req_op);
@@ -5117,15 +5117,13 @@ int ceph_osdc_setup(void)
51175117

51185118
return ceph_osd_request_cache ? 0 : -ENOMEM;
51195119
}
5120-
EXPORT_SYMBOL(ceph_osdc_setup);
51215120

51225121
void ceph_osdc_cleanup(void)
51235122
{
51245123
BUG_ON(!ceph_osd_request_cache);
51255124
kmem_cache_destroy(ceph_osd_request_cache);
51265125
ceph_osd_request_cache = NULL;
51275126
}
5128-
EXPORT_SYMBOL(ceph_osdc_cleanup);
51295127

51305128
/*
51315129
* handle incoming message

0 commit comments

Comments
 (0)