[PATCH] fix static linking of NFS
authorDavid Brownell <david-b@pacbell.net>
Tue, 27 Jun 2006 19:59:15 +0000 (12:59 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 27 Jun 2006 21:07:19 +0000 (14:07 -0700)
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>
fs/nfs/direct.c
fs/nfs/inode.c
fs/nfs/internal.h
fs/nfs/pagelist.c
fs/nfs/read.c
fs/nfs/write.c

index 402005c35ab3fecd963329ff42be0b111f278381..8ca9707be6c9d06f28a843fbe6282afd1d405e77 100644 (file)
@@ -909,7 +909,7 @@ int __init nfs_init_directcache(void)
  * nfs_destroy_directcache - destroy the slab cache for nfs_direct_req structures
  *
  */
-void __exit nfs_destroy_directcache(void)
+void nfs_destroy_directcache(void)
 {
        if (kmem_cache_destroy(nfs_direct_cachep))
                printk(KERN_INFO "nfs_direct_cache: not all structures were freed\n");
index 51bc88b662feabeb54f0873c1876296adabc0b25..c5b916605fb012b856bdee1c5cc8c8b4d9a8c81a 100644 (file)
@@ -1132,7 +1132,7 @@ static int __init nfs_init_inodecache(void)
        return 0;
 }
 
-static void __exit nfs_destroy_inodecache(void)
+static void nfs_destroy_inodecache(void)
 {
        if (kmem_cache_destroy(nfs_inode_cachep))
                printk(KERN_INFO "nfs_inode_cache: not all structures were freed\n");
index bd2815e2dec1b924bf52bb803f490066c76b2e94..4fe51c1292bb763918cd885c0df1ba093fccd80e 100644 (file)
@@ -31,15 +31,15 @@ extern struct svc_version nfs4_callback_version1;
 
 /* pagelist.c */
 extern int __init nfs_init_nfspagecache(void);
-extern void __exit nfs_destroy_nfspagecache(void);
+extern void nfs_destroy_nfspagecache(void);
 extern int __init nfs_init_readpagecache(void);
-extern void __exit nfs_destroy_readpagecache(void);
+extern void nfs_destroy_readpagecache(void);
 extern int __init nfs_init_writepagecache(void);
-extern void __exit nfs_destroy_writepagecache(void);
+extern void nfs_destroy_writepagecache(void);
 
 #ifdef CONFIG_NFS_DIRECTIO
 extern int __init nfs_init_directcache(void);
-extern void __exit nfs_destroy_directcache(void);
+extern void nfs_destroy_directcache(void);
 #else
 #define nfs_init_directcache() (0)
 #define nfs_destroy_directcache() do {} while(0)
index ef9429643ebcc8e231268e58551cbf899df0336c..d89f6fb3b3a3517fea9679caec85982584ad7d81 100644 (file)
@@ -390,7 +390,7 @@ int __init nfs_init_nfspagecache(void)
        return 0;
 }
 
-void __exit nfs_destroy_nfspagecache(void)
+void nfs_destroy_nfspagecache(void)
 {
        if (kmem_cache_destroy(nfs_page_cachep))
                printk(KERN_INFO "nfs_page: not all structures were freed\n");
index 41c2ffee24f566dabf38f271e6ecdfa3fa3ea0d1..32cf3773af0cdc0a21b41363e6ddc34c7a40bff2 100644 (file)
@@ -711,7 +711,7 @@ int __init nfs_init_readpagecache(void)
        return 0;
 }
 
-void __exit nfs_destroy_readpagecache(void)
+void nfs_destroy_readpagecache(void)
 {
        mempool_destroy(nfs_rdata_mempool);
        if (kmem_cache_destroy(nfs_rdata_cachep))
index b383fdd3a15c1a5b6b621415b46ffe390a3294d2..8fccb9cb173ba9588c6f8946ba69cc67485659c2 100644 (file)
@@ -1551,7 +1551,7 @@ int __init nfs_init_writepagecache(void)
        return 0;
 }
 
-void __exit nfs_destroy_writepagecache(void)
+void nfs_destroy_writepagecache(void)
 {
        mempool_destroy(nfs_commit_mempool);
        mempool_destroy(nfs_wdata_mempool);