From: Adrian Bunk <bunk@stusta.de>

This patch makes some needlessly global code static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/nfs/inode.c          |    8 +++++---
 25-akpm/fs/nfs/mount_clnt.c     |    4 ++--
 25-akpm/fs/nfs/nfs4proc.c       |    9 +++++----
 25-akpm/fs/nfs/nfsroot.c        |    4 ++--
 25-akpm/fs/nfs/read.c           |    2 +-
 25-akpm/fs/nfs/write.c          |   29 +++++++++++++++++++++++------
 25-akpm/include/linux/nfs_fs.h  |   24 ------------------------
 25-akpm/include/linux/nfs_xdr.h |    2 --
 8 files changed, 38 insertions(+), 44 deletions(-)

diff -puN fs/nfs/inode.c~fs-nfs-make-some-code-static fs/nfs/inode.c
--- 25/fs/nfs/inode.c~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/fs/nfs/inode.c	Mon Feb  7 15:19:08 2005
@@ -77,6 +77,8 @@ static inline void __nfs_forget_cached_a
 }
 #endif
 
+static struct rpc_program	nfs_program;
+
 static struct super_operations nfs_sops = { 
 	.alloc_inode	= nfs_alloc_inode,
 	.destroy_inode	= nfs_destroy_inode,
@@ -91,7 +93,7 @@ static struct super_operations nfs_sops 
 /*
  * RPC cruft for NFS
  */
-struct rpc_stat			nfs_rpcstat = {
+static struct rpc_stat		nfs_rpcstat = {
 	.program		= &nfs_program
 };
 static struct rpc_version *	nfs_version[] = {
@@ -108,7 +110,7 @@ static struct rpc_version *	nfs_version[
 #endif
 };
 
-struct rpc_program		nfs_program = {
+static struct rpc_program	nfs_program = {
 	.name			= "nfs",
 	.number			= NFS_PROGRAM,
 	.nrvers			= sizeof(nfs_version) / sizeof(nfs_version[0]),
@@ -856,7 +858,7 @@ nfs_setattr(struct dentry *dentry, struc
  * Wait for the inode to get unlocked.
  * (Used for NFS_INO_LOCKED and NFS_INO_REVALIDATING).
  */
-int
+static int
 nfs_wait_on_inode(struct inode *inode, int flag)
 {
 	struct rpc_clnt	*clnt = NFS_CLIENT(inode);
diff -puN fs/nfs/mount_clnt.c~fs-nfs-make-some-code-static fs/nfs/mount_clnt.c
--- 25/fs/nfs/mount_clnt.c~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/fs/nfs/mount_clnt.c	Mon Feb  7 15:19:08 2005
@@ -31,7 +31,7 @@
 
 static struct rpc_clnt *	mnt_create(char *, struct sockaddr_in *,
 								int, int);
-struct rpc_program		mnt_program;
+static struct rpc_program	mnt_program;
 
 struct mnt_fhstatus {
 	unsigned int		status;
@@ -174,7 +174,7 @@ static struct rpc_version *	mnt_version[
 
 static struct rpc_stat		mnt_stats;
 
-struct rpc_program	mnt_program = {
+static struct rpc_program	mnt_program = {
 	.name		= "mount",
 	.number		= NFS_MNT_PROGRAM,
 	.nrvers		= sizeof(mnt_version)/sizeof(mnt_version[0]),
diff -puN fs/nfs/nfs4proc.c~fs-nfs-make-some-code-static fs/nfs/nfs4proc.c
--- 25/fs/nfs/nfs4proc.c~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/fs/nfs/nfs4proc.c	Mon Feb  7 15:19:08 2005
@@ -57,6 +57,7 @@
 static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
 static int nfs4_async_handle_error(struct rpc_task *, struct nfs_server *);
 static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry);
+static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_exception *exception);
 extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus);
 extern struct rpc_procinfo nfs4_procedures[];
 
@@ -381,7 +382,7 @@ out:
 /*
  * Returns an nfs4_state + an extra reference to the inode
  */
-int _nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred *cred, struct nfs4_state **res)
+static int _nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred *cred, struct nfs4_state **res)
 {
 	struct nfs_delegation *delegation;
 	struct nfs_server *server = NFS_SERVER(inode);
@@ -581,7 +582,7 @@ out_err:
 }
 
 
-struct nfs4_state *nfs4_do_open(struct inode *dir, struct dentry *dentry, int flags, struct iattr *sattr, struct rpc_cred *cred)
+static struct nfs4_state *nfs4_do_open(struct inode *dir, struct dentry *dentry, int flags, struct iattr *sattr, struct rpc_cred *cred)
 {
 	struct nfs4_exception exception = { };
 	struct nfs4_state *res;
@@ -645,7 +646,7 @@ static int _nfs4_do_setattr(struct nfs_s
 	return rpc_call_sync(server->client, &msg, 0);
 }
 
-int nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr,
+static int nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr,
                 struct nfs_fh *fhandle, struct iattr *sattr,
                 struct nfs4_state *state)
 {
@@ -2067,7 +2068,7 @@ nfs4_async_handle_error(struct rpc_task 
 	return 0;
 }
 
-int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs4_client *clp)
+static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs4_client *clp)
 {
 	DEFINE_WAIT(wait);
 	sigset_t oldset;
diff -puN fs/nfs/nfsroot.c~fs-nfs-make-some-code-static fs/nfs/nfsroot.c
--- 25/fs/nfs/nfsroot.c~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/fs/nfs/nfsroot.c	Mon Feb  7 15:19:08 2005
@@ -351,7 +351,7 @@ static void __init root_nfs_print(void)
 #endif
 
 
-int __init root_nfs_init(void)
+static int __init root_nfs_init(void)
 {
 #ifdef NFSROOT_DEBUG
 	nfs_debug |= NFSDBG_ROOT;
@@ -379,7 +379,7 @@ int __init root_nfs_init(void)
  *  Parse NFS server and directory information passed on the kernel
  *  command line.
  */
-int __init nfs_root_setup(char *line)
+static int __init nfs_root_setup(char *line)
 {
 	ROOT_DEV = Root_NFS;
 	if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) {
diff -puN fs/nfs/read.c~fs-nfs-make-some-code-static fs/nfs/read.c
--- 25/fs/nfs/read.c~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/fs/nfs/read.c	Mon Feb  7 15:19:08 2005
@@ -370,7 +370,7 @@ out_bad:
 	return -ENOMEM;
 }
 
-int
+static int
 nfs_pagein_list(struct list_head *head, int rpages)
 {
 	LIST_HEAD(one_request);
diff -puN fs/nfs/write.c~fs-nfs-make-some-code-static fs/nfs/write.c
--- 25/fs/nfs/write.c~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/fs/nfs/write.c	Mon Feb  7 15:19:08 2005
@@ -80,14 +80,31 @@ static void nfs_writeback_done_partial(s
 static void nfs_writeback_done_full(struct nfs_write_data *, int);
 static int nfs_wait_on_write_congestion(struct address_space *, int);
 static int nfs_wait_on_requests(struct inode *, unsigned long, unsigned int);
+static int nfs_flush_inode(struct inode *inode, unsigned long idx_start,
+			   unsigned int npages, int how);
 
 static kmem_cache_t *nfs_wdata_cachep;
 mempool_t *nfs_wdata_mempool;
-mempool_t *nfs_commit_mempool;
+static mempool_t *nfs_commit_mempool;
 
 static DECLARE_WAIT_QUEUE_HEAD(nfs_write_congestion);
 
-void nfs_writedata_release(struct rpc_task *task)
+static inline struct nfs_write_data *nfs_commit_alloc(void)
+{
+	struct nfs_write_data *p = mempool_alloc(nfs_commit_mempool, SLAB_NOFS);
+	if (p) {
+		memset(p, 0, sizeof(*p));
+		INIT_LIST_HEAD(&p->pages);
+	}
+	return p;
+}
+
+static inline void nfs_commit_free(struct nfs_write_data *p)
+{
+	mempool_free(p, nfs_commit_mempool);
+}
+
+static void nfs_writedata_release(struct rpc_task *task)
 {
 	struct nfs_write_data	*wdata = (struct nfs_write_data *)task->tk_calldata;
 	nfs_writedata_free(wdata);
@@ -990,7 +1007,7 @@ static int nfs_flush_one(struct list_hea
 	return -ENOMEM;
 }
 
-int
+static int
 nfs_flush_list(struct list_head *head, int wpages, int how)
 {
 	LIST_HEAD(one_request);
@@ -1240,7 +1257,7 @@ static void nfs_commit_rpcsetup(struct l
 /*
  * Commit dirty pages
  */
-int
+static int
 nfs_commit_list(struct list_head *head, int how)
 {
 	struct nfs_write_data	*data;
@@ -1314,8 +1331,8 @@ nfs_commit_done(struct rpc_task *task)
 }
 #endif
 
-int nfs_flush_inode(struct inode *inode, unsigned long idx_start,
-		   unsigned int npages, int how)
+static int nfs_flush_inode(struct inode *inode, unsigned long idx_start,
+			   unsigned int npages, int how)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
 	LIST_HEAD(head);
diff -puN include/linux/nfs_fs.h~fs-nfs-make-some-code-static include/linux/nfs_fs.h
--- 25/include/linux/nfs_fs.h~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/include/linux/nfs_fs.h	Mon Feb  7 15:19:08 2005
@@ -399,11 +399,8 @@ extern void nfs_commit_done(struct rpc_t
  * return value!)
  */
 extern int  nfs_sync_inode(struct inode *, unsigned long, unsigned int, int);
-extern int  nfs_flush_inode(struct inode *, unsigned long, unsigned int, int);
-extern int  nfs_flush_list(struct list_head *, int, int);
 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
 extern int  nfs_commit_inode(struct inode *, unsigned long, unsigned int, int);
-extern int  nfs_commit_list(struct list_head *, int);
 #else
 static inline int
 nfs_commit_inode(struct inode *inode, unsigned long idx_start, unsigned int npages, int how)
@@ -444,7 +441,6 @@ static inline int nfs_wb_page(struct ino
  * Allocate and free nfs_write_data structures
  */
 extern mempool_t *nfs_wdata_mempool;
-extern mempool_t *nfs_commit_mempool;
 
 static inline struct nfs_write_data *nfs_writedata_alloc(void)
 {
@@ -461,23 +457,6 @@ static inline void nfs_writedata_free(st
 	mempool_free(p, nfs_wdata_mempool);
 }
 
-extern void  nfs_writedata_release(struct rpc_task *task);
-
-static inline struct nfs_write_data *nfs_commit_alloc(void)
-{
-	struct nfs_write_data *p = mempool_alloc(nfs_commit_mempool, SLAB_NOFS);
-	if (p) {
-		memset(p, 0, sizeof(*p));
-		INIT_LIST_HEAD(&p->pages);
-	}
-	return p;
-}
-
-static inline void nfs_commit_free(struct nfs_write_data *p)
-{
-	mempool_free(p, nfs_commit_mempool);
-}
-
 /* Hack for future NFS swap support */
 #ifndef IS_SWAPFILE
 # define IS_SWAPFILE(inode)	(0)
@@ -489,7 +468,6 @@ static inline void nfs_commit_free(struc
 extern int  nfs_readpage(struct file *, struct page *);
 extern int  nfs_readpages(struct file *, struct address_space *,
 		struct list_head *, unsigned);
-extern int  nfs_pagein_list(struct list_head *, int);
 extern void nfs_readpage_result(struct rpc_task *);
 
 /*
@@ -726,10 +704,8 @@ extern int nfs4_open_reclaim(struct nfs4
 extern int nfs4_proc_async_renew(struct nfs4_client *);
 extern int nfs4_proc_renew(struct nfs4_client *);
 extern int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode);
-extern int nfs4_wait_clnt_recover(struct rpc_clnt *, struct nfs4_client *);
 extern struct inode *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *);
 extern int nfs4_open_revalidate(struct inode *, struct dentry *, int);
-extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *);
 extern int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request);
 
 /* nfs4renewd.c */
diff -puN include/linux/nfs_xdr.h~fs-nfs-make-some-code-static include/linux/nfs_xdr.h
--- 25/include/linux/nfs_xdr.h~fs-nfs-make-some-code-static	Mon Feb  7 15:19:08 2005
+++ 25-akpm/include/linux/nfs_xdr.h	Mon Feb  7 15:19:08 2005
@@ -760,8 +760,6 @@ extern struct nfs_rpc_ops	nfs_v4_cliento
 extern struct rpc_version	nfs_version2;
 extern struct rpc_version	nfs_version3;
 extern struct rpc_version	nfs_version4;
-extern struct rpc_program	nfs_program;
-extern struct rpc_stat		nfs_rpcstat;
 
 extern struct rpc_version	nfsacl_version3;
 extern struct rpc_program	nfsacl_program;
_