Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

David Brownell and committed by
Linus Torvalds
266bee88 e7374e48

+9 -9
+1 -1
fs/nfs/direct.c
··· 909 909 * nfs_destroy_directcache - destroy the slab cache for nfs_direct_req structures 910 910 * 911 911 */ 912 - void __exit nfs_destroy_directcache(void) 912 + void nfs_destroy_directcache(void) 913 913 { 914 914 if (kmem_cache_destroy(nfs_direct_cachep)) 915 915 printk(KERN_INFO "nfs_direct_cache: not all structures were freed\n");
+1 -1
fs/nfs/inode.c
··· 1132 1132 return 0; 1133 1133 } 1134 1134 1135 - static void __exit nfs_destroy_inodecache(void) 1135 + static void nfs_destroy_inodecache(void) 1136 1136 { 1137 1137 if (kmem_cache_destroy(nfs_inode_cachep)) 1138 1138 printk(KERN_INFO "nfs_inode_cache: not all structures were freed\n");
+4 -4
fs/nfs/internal.h
··· 31 31 32 32 /* pagelist.c */ 33 33 extern int __init nfs_init_nfspagecache(void); 34 - extern void __exit nfs_destroy_nfspagecache(void); 34 + extern void nfs_destroy_nfspagecache(void); 35 35 extern int __init nfs_init_readpagecache(void); 36 - extern void __exit nfs_destroy_readpagecache(void); 36 + extern void nfs_destroy_readpagecache(void); 37 37 extern int __init nfs_init_writepagecache(void); 38 - extern void __exit nfs_destroy_writepagecache(void); 38 + extern void nfs_destroy_writepagecache(void); 39 39 40 40 #ifdef CONFIG_NFS_DIRECTIO 41 41 extern int __init nfs_init_directcache(void); 42 - extern void __exit nfs_destroy_directcache(void); 42 + extern void nfs_destroy_directcache(void); 43 43 #else 44 44 #define nfs_init_directcache() (0) 45 45 #define nfs_destroy_directcache() do {} while(0)
+1 -1
fs/nfs/pagelist.c
··· 390 390 return 0; 391 391 } 392 392 393 - void __exit nfs_destroy_nfspagecache(void) 393 + void nfs_destroy_nfspagecache(void) 394 394 { 395 395 if (kmem_cache_destroy(nfs_page_cachep)) 396 396 printk(KERN_INFO "nfs_page: not all structures were freed\n");
+1 -1
fs/nfs/read.c
··· 711 711 return 0; 712 712 } 713 713 714 - void __exit nfs_destroy_readpagecache(void) 714 + void nfs_destroy_readpagecache(void) 715 715 { 716 716 mempool_destroy(nfs_rdata_mempool); 717 717 if (kmem_cache_destroy(nfs_rdata_cachep))
+1 -1
fs/nfs/write.c
··· 1551 1551 return 0; 1552 1552 } 1553 1553 1554 - void __exit nfs_destroy_writepagecache(void) 1554 + void nfs_destroy_writepagecache(void) 1555 1555 { 1556 1556 mempool_destroy(nfs_commit_mempool); 1557 1557 mempool_destroy(nfs_wdata_mempool);