public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: linux-kernel@vger.kernel.org
Cc: trond.myklebust@fys.uio.no
Subject: fs/nfs - cleanup function declarations
Date: Mon, 31 Oct 2005 12:29:50 +0000	[thread overview]
Message-ID: <20051031122950.GA12009@home.fluff.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 5390 bytes --]

Cleanup sparse warnings from fs/nfs, mainly
due to undeclared functions or missing static
from functions.

This patch does the following:

1) place static on both the nfs_llseek_dir and
   nfs_fsync_dir in dir.c as they where earlier
   declared static

2) add shared.h, and put declarations of the
   init functions into it.

3) use inline to remove DIRECTIO initialisation
   support to cleanup the init/exit code paths

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/dir.c linux-2.6.14-git3-bjd1/fs/nfs/dir.c
--- linux-2.6.14-git3/fs/nfs/dir.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/dir.c	2005-10-31 11:39:27.000000000 +0000
@@ -571,7 +571,7 @@ static int nfs_readdir(struct file *filp
 	return 0;
 }
 
-loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
+static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
 {
 	down(&filp->f_dentry->d_inode->i_sem);
 	switch (origin) {
@@ -597,7 +597,7 @@ out:
  * All directory operations under NFS are synchronous, so fsync()
  * is a dummy operation.
  */
-int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
+static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
 {
 	return 0;
 }
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/direct.c linux-2.6.14-git3-bjd1/fs/nfs/direct.c
--- linux-2.6.14-git3/fs/nfs/direct.c	2005-09-01 21:02:38.000000000 +0100
+++ linux-2.6.14-git3-bjd1/fs/nfs/direct.c	2005-10-31 12:20:25.000000000 +0000
@@ -54,6 +54,8 @@
 #include <asm/uaccess.h>
 #include <asm/atomic.h>
 
+#include "shared.h"
+
 #define NFSDBG_FACILITY		NFSDBG_VFS
 #define MAX_DIRECTIO_SIZE	(4096UL << PAGE_SHIFT)
 
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/inode.c linux-2.6.14-git3-bjd1/fs/nfs/inode.c
--- linux-2.6.14-git3/fs/nfs/inode.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/inode.c	2005-10-31 12:19:40.000000000 +0000
@@ -41,6 +41,7 @@
 
 #include "nfs4_fs.h"
 #include "delegation.h"
+#include "shared.h"
 
 #define NFSDBG_FACILITY		NFSDBG_VFS
 #define NFS_PARANOIA 1
@@ -2047,17 +2048,6 @@ static struct file_system_type nfs4_fs_t
 #define unregister_nfs4fs()
 #endif
 
-extern int nfs_init_nfspagecache(void);
-extern void nfs_destroy_nfspagecache(void);
-extern int nfs_init_readpagecache(void);
-extern void nfs_destroy_readpagecache(void);
-extern int nfs_init_writepagecache(void);
-extern void nfs_destroy_writepagecache(void);
-#ifdef CONFIG_NFS_DIRECTIO
-extern int nfs_init_directcache(void);
-extern void nfs_destroy_directcache(void);
-#endif
-
 static kmem_cache_t * nfs_inode_cachep;
 
 static struct inode *nfs_alloc_inode(struct super_block *sb)
@@ -2144,11 +2134,9 @@ static int __init init_nfs_fs(void)
 	if (err)
 		goto out1;
 
-#ifdef CONFIG_NFS_DIRECTIO
 	err = nfs_init_directcache();
 	if (err)
 		goto out0;
-#endif
 
 #ifdef CONFIG_PROC_FS
 	rpc_proc_register(&nfs_rpcstat);
@@ -2164,10 +2152,8 @@ out:
 	rpc_proc_unregister("nfs");
 #endif
 	nfs_destroy_writepagecache();
-#ifdef CONFIG_NFS_DIRECTIO
 out0:
 	nfs_destroy_directcache();
-#endif
 out1:
 	nfs_destroy_readpagecache();
 out2:
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/pagelist.c linux-2.6.14-git3-bjd1/fs/nfs/pagelist.c
--- linux-2.6.14-git3/fs/nfs/pagelist.c	2005-09-01 21:02:38.000000000 +0100
+++ linux-2.6.14-git3-bjd1/fs/nfs/pagelist.c	2005-10-31 12:06:59.000000000 +0000
@@ -19,6 +19,8 @@
 #include <linux/nfs_fs.h>
 #include <linux/nfs_mount.h>
 
+#include "shared.h"
+
 #define NFS_PARANOIA 1
 
 static kmem_cache_t *nfs_page_cachep;
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/read.c linux-2.6.14-git3-bjd1/fs/nfs/read.c
--- linux-2.6.14-git3/fs/nfs/read.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/read.c	2005-10-31 12:08:50.000000000 +0000
@@ -31,6 +31,8 @@
 
 #include <asm/system.h>
 
+#include "shared.h"
+
 #define NFSDBG_FACILITY		NFSDBG_PAGECACHE
 
 static int nfs_pagein_one(struct list_head *, struct inode *);
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/shared.h linux-2.6.14-git3-bjd1/fs/nfs/shared.h
--- linux-2.6.14-git3/fs/nfs/shared.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.14-git3-bjd1/fs/nfs/shared.h	2005-10-31 12:20:11.000000000 +0000
@@ -0,0 +1,29 @@
+/* fs/nfs/shared.h
+ *
+ * common declarations for items shared in fs/nfs
+ *	(c) 2005 Ben Dooks <ben-linux@fluff.org), GPLv2 License
+*/
+
+/* read.c */
+extern int nfs_init_readpagecache(void);
+extern void nfs_destroy_readpagecache(void);
+
+/* write.c */
+extern int nfs_init_writepagecache(void);
+extern void nfs_destroy_writepagecache(void);
+
+/* pagelist.c */
+extern int nfs_init_nfspagecache(void);
+extern void nfs_destroy_nfspagecache(void);
+
+#ifdef CONFIG_NFS_DIRECTIO
+extern int nfs_init_directcache(void);
+extern void nfs_destroy_directcache(void);
+#else
+static inline int nfs_init_directcache(void)
+{
+	return 0;
+}
+
+static inline void nfs_destroy_directcache(void) { }
+#endif
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/write.c linux-2.6.14-git3-bjd1/fs/nfs/write.c
--- linux-2.6.14-git3/fs/nfs/write.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/write.c	2005-10-31 12:08:49.000000000 +0000
@@ -63,6 +63,7 @@
 #include <linux/smp_lock.h>
 
 #include "delegation.h"
+#include "shared.h"
 
 #define NFSDBG_FACILITY		NFSDBG_PAGECACHE
 

[-- Attachment #2: 2614-nfs-common-decl.patch --]
[-- Type: text/plain, Size: 4919 bytes --]

diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/dir.c linux-2.6.14-git3-bjd1/fs/nfs/dir.c
--- linux-2.6.14-git3/fs/nfs/dir.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/dir.c	2005-10-31 11:39:27.000000000 +0000
@@ -571,7 +571,7 @@ static int nfs_readdir(struct file *filp
 	return 0;
 }
 
-loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
+static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
 {
 	down(&filp->f_dentry->d_inode->i_sem);
 	switch (origin) {
@@ -597,7 +597,7 @@ out:
  * All directory operations under NFS are synchronous, so fsync()
  * is a dummy operation.
  */
-int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
+static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
 {
 	return 0;
 }
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/direct.c linux-2.6.14-git3-bjd1/fs/nfs/direct.c
--- linux-2.6.14-git3/fs/nfs/direct.c	2005-09-01 21:02:38.000000000 +0100
+++ linux-2.6.14-git3-bjd1/fs/nfs/direct.c	2005-10-31 12:20:25.000000000 +0000
@@ -54,6 +54,8 @@
 #include <asm/uaccess.h>
 #include <asm/atomic.h>
 
+#include "shared.h"
+
 #define NFSDBG_FACILITY		NFSDBG_VFS
 #define MAX_DIRECTIO_SIZE	(4096UL << PAGE_SHIFT)
 
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/inode.c linux-2.6.14-git3-bjd1/fs/nfs/inode.c
--- linux-2.6.14-git3/fs/nfs/inode.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/inode.c	2005-10-31 12:19:40.000000000 +0000
@@ -41,6 +41,7 @@
 
 #include "nfs4_fs.h"
 #include "delegation.h"
+#include "shared.h"
 
 #define NFSDBG_FACILITY		NFSDBG_VFS
 #define NFS_PARANOIA 1
@@ -2047,17 +2048,6 @@ static struct file_system_type nfs4_fs_t
 #define unregister_nfs4fs()
 #endif
 
-extern int nfs_init_nfspagecache(void);
-extern void nfs_destroy_nfspagecache(void);
-extern int nfs_init_readpagecache(void);
-extern void nfs_destroy_readpagecache(void);
-extern int nfs_init_writepagecache(void);
-extern void nfs_destroy_writepagecache(void);
-#ifdef CONFIG_NFS_DIRECTIO
-extern int nfs_init_directcache(void);
-extern void nfs_destroy_directcache(void);
-#endif
-
 static kmem_cache_t * nfs_inode_cachep;
 
 static struct inode *nfs_alloc_inode(struct super_block *sb)
@@ -2144,11 +2134,9 @@ static int __init init_nfs_fs(void)
 	if (err)
 		goto out1;
 
-#ifdef CONFIG_NFS_DIRECTIO
 	err = nfs_init_directcache();
 	if (err)
 		goto out0;
-#endif
 
 #ifdef CONFIG_PROC_FS
 	rpc_proc_register(&nfs_rpcstat);
@@ -2164,10 +2152,8 @@ out:
 	rpc_proc_unregister("nfs");
 #endif
 	nfs_destroy_writepagecache();
-#ifdef CONFIG_NFS_DIRECTIO
 out0:
 	nfs_destroy_directcache();
-#endif
 out1:
 	nfs_destroy_readpagecache();
 out2:
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/pagelist.c linux-2.6.14-git3-bjd1/fs/nfs/pagelist.c
--- linux-2.6.14-git3/fs/nfs/pagelist.c	2005-09-01 21:02:38.000000000 +0100
+++ linux-2.6.14-git3-bjd1/fs/nfs/pagelist.c	2005-10-31 12:06:59.000000000 +0000
@@ -19,6 +19,8 @@
 #include <linux/nfs_fs.h>
 #include <linux/nfs_mount.h>
 
+#include "shared.h"
+
 #define NFS_PARANOIA 1
 
 static kmem_cache_t *nfs_page_cachep;
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/read.c linux-2.6.14-git3-bjd1/fs/nfs/read.c
--- linux-2.6.14-git3/fs/nfs/read.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/read.c	2005-10-31 12:08:50.000000000 +0000
@@ -31,6 +31,8 @@
 
 #include <asm/system.h>
 
+#include "shared.h"
+
 #define NFSDBG_FACILITY		NFSDBG_PAGECACHE
 
 static int nfs_pagein_one(struct list_head *, struct inode *);
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/shared.h linux-2.6.14-git3-bjd1/fs/nfs/shared.h
--- linux-2.6.14-git3/fs/nfs/shared.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.14-git3-bjd1/fs/nfs/shared.h	2005-10-31 12:20:11.000000000 +0000
@@ -0,0 +1,29 @@
+/* fs/nfs/shared.h
+ *
+ * common declarations for items shared in fs/nfs
+ *	(c) 2005 Ben Dooks <ben-linux@fluff.org), GPLv2 License
+*/
+
+/* read.c */
+extern int nfs_init_readpagecache(void);
+extern void nfs_destroy_readpagecache(void);
+
+/* write.c */
+extern int nfs_init_writepagecache(void);
+extern void nfs_destroy_writepagecache(void);
+
+/* pagelist.c */
+extern int nfs_init_nfspagecache(void);
+extern void nfs_destroy_nfspagecache(void);
+
+#ifdef CONFIG_NFS_DIRECTIO
+extern int nfs_init_directcache(void);
+extern void nfs_destroy_directcache(void);
+#else
+static inline int nfs_init_directcache(void)
+{
+	return 0;
+}
+
+static inline void nfs_destroy_directcache(void) { }
+#endif
diff -urpN -X ../dontdiff linux-2.6.14-git3/fs/nfs/write.c linux-2.6.14-git3-bjd1/fs/nfs/write.c
--- linux-2.6.14-git3/fs/nfs/write.c	2005-10-31 11:17:07.000000000 +0000
+++ linux-2.6.14-git3-bjd1/fs/nfs/write.c	2005-10-31 12:08:49.000000000 +0000
@@ -63,6 +63,7 @@
 #include <linux/smp_lock.h>
 
 #include "delegation.h"
+#include "shared.h"
 
 #define NFSDBG_FACILITY		NFSDBG_PAGECACHE
 

             reply	other threads:[~2005-10-31 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31 12:29 Ben Dooks [this message]
2005-10-31 12:34 ` fs/nfs - cleanup function declarations Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051031122950.GA12009@home.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox