fs/nfs - cleanup function declarations
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
fs/nfs/dir.c +2 -2
@@ -571,7 +571,7 @@ static int nfs_readdir(struct file *filpreturn 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 ; }
fs/nfs/direct.c +2 -0
@@ -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)
fs/nfs/inode.c +1 -15
@@ -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:
fs/nfs/pagelist.c +2 -0
@@ -19,6 +19,8 @@#include <linux/nfs_fs.h> #include <linux/nfs_mount.h> +#include "shared.h" +#define NFS_PARANOIA 1static kmem_cache_t *nfs_page_cachep;
fs/nfs/read.c +2 -0
@@ -31,6 +31,8 @@#include <asm/system.h> +#include "shared.h" +#define NFSDBG_FACILITY NFSDBG_PAGECACHEstatic int nfs_pagein_one (struct list_head *,struct inode *);
fs/nfs/shared.h +29 -0
@@ -0,0 +1,29 @@ +/* fs/nfs/shared.h +* +* common declarations for items shared in fs/nfs +* (c) 2005 Ben Dooks <[email protected]), 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
fs/nfs/write.c +1 -0
@@ -63,6 +63,7 @@#include <linux/smp_lock.h> #include "delegation.h" +#include "shared.h" #define NFSDBG_FACILITY NFSDBG_PAGECACHE
fs/nfs/dir.c +2 -2
@@ -571,7 +571,7 @@ static int nfs_readdir(struct file *filpreturn 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 ; }
fs/nfs/direct.c +2 -0
@@ -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)
fs/nfs/inode.c +1 -15
@@ -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:
fs/nfs/pagelist.c +2 -0
@@ -19,6 +19,8 @@#include <linux/nfs_fs.h> #include <linux/nfs_mount.h> +#include "shared.h" +#define NFS_PARANOIA 1static kmem_cache_t *nfs_page_cachep;
fs/nfs/read.c +2 -0
@@ -31,6 +31,8 @@#include <asm/system.h> +#include "shared.h" +#define NFSDBG_FACILITY NFSDBG_PAGECACHEstatic int nfs_pagein_one (struct list_head *,struct inode *);
fs/nfs/shared.h +29 -0
@@ -0,0 +1,29 @@ +/* fs/nfs/shared.h +* +* common declarations for items shared in fs/nfs +* (c) 2005 Ben Dooks <[email protected]), 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
fs/nfs/write.c +1 -0
@@ -63,6 +63,7 @@#include <linux/smp_lock.h> #include "delegation.h" +#include "shared.h" #define NFSDBG_FACILITY NFSDBG_PAGECACHE
Quoted 10 lines · Ben Dooks
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_dirand
nfs_fsync_dirindir.cas they where earlier
declared static
Quoted 7 lines
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 pathsSigned-off-by Ben Dooks <[email protected]>
ACKed
Cheers,
Trond