Skip to content

Commit 266bee8

Browse files
David BrownellLinus Torvalds
authored andcommitted
[PATCH] fix static linking of NFS
Builds on ARM report link problems with common configurations like statically linked NFS (for nfsroot). The symptom is that __init section code references __exit section code; that won't work since the exit sections are discarded (since they can never be called). The best fix for these particular cases would be an "__init_or_exit" section annotation. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent e7374e4 commit 266bee8

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎fs/nfs/direct.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ int __init nfs_init_directcache(void)
909909
* nfs_destroy_directcache - destroy the slab cache for nfs_direct_req structures
910910
*
911911
*/
912-
void __exit nfs_destroy_directcache(void)
912+
void nfs_destroy_directcache(void)
913913
{
914914
if (kmem_cache_destroy(nfs_direct_cachep))
915915
printk(KERN_INFO "nfs_direct_cache: not all structures were freed\n");

‎fs/nfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ static int __init nfs_init_inodecache(void)
11321132
return 0;
11331133
}
11341134

1135-
static void __exit nfs_destroy_inodecache(void)
1135+
static void nfs_destroy_inodecache(void)
11361136
{
11371137
if (kmem_cache_destroy(nfs_inode_cachep))
11381138
printk(KERN_INFO "nfs_inode_cache: not all structures were freed\n");

‎fs/nfs/internal.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ extern struct svc_version nfs4_callback_version1;
3131

3232
/* pagelist.c */
3333
extern int __init nfs_init_nfspagecache(void);
34-
extern void __exit nfs_destroy_nfspagecache(void);
34+
extern void nfs_destroy_nfspagecache(void);
3535
extern int __init nfs_init_readpagecache(void);
36-
extern void __exit nfs_destroy_readpagecache(void);
36+
extern void nfs_destroy_readpagecache(void);
3737
extern int __init nfs_init_writepagecache(void);
38-
extern void __exit nfs_destroy_writepagecache(void);
38+
extern void nfs_destroy_writepagecache(void);
3939

4040
#ifdef CONFIG_NFS_DIRECTIO
4141
extern int __init nfs_init_directcache(void);
42-
extern void __exit nfs_destroy_directcache(void);
42+
extern void nfs_destroy_directcache(void);
4343
#else
4444
#define nfs_init_directcache() (0)
4545
#define nfs_destroy_directcache() do {} while(0)

‎fs/nfs/pagelist.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ int __init nfs_init_nfspagecache(void)
390390
return 0;
391391
}
392392

393-
void __exit nfs_destroy_nfspagecache(void)
393+
void nfs_destroy_nfspagecache(void)
394394
{
395395
if (kmem_cache_destroy(nfs_page_cachep))
396396
printk(KERN_INFO "nfs_page: not all structures were freed\n");

‎fs/nfs/read.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ int __init nfs_init_readpagecache(void)
711711
return 0;
712712
}
713713

714-
void __exit nfs_destroy_readpagecache(void)
714+
void nfs_destroy_readpagecache(void)
715715
{
716716
mempool_destroy(nfs_rdata_mempool);
717717
if (kmem_cache_destroy(nfs_rdata_cachep))

‎fs/nfs/write.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ int __init nfs_init_writepagecache(void)
15511551
return 0;
15521552
}
15531553

1554-
void __exit nfs_destroy_writepagecache(void)
1554+
void nfs_destroy_writepagecache(void)
15551555
{
15561556
mempool_destroy(nfs_commit_mempool);
15571557
mempool_destroy(nfs_wdata_mempool);

0 commit comments

Comments
 (0)