Skip to content

Commit

Permalink
NFS: Split fs/nfs/inode.c
Browse files Browse the repository at this point in the history
As fs/nfs/inode.c is rather large, heterogenous and unwieldy, the attached
patch splits it up into a number of files:

 (*) fs/nfs/inode.c

     Strictly inode specific functions.

 (*) fs/nfs/super.c

     Superblock management functions for NFS and NFS4, normal access, clones
     and referrals.  The NFS4 superblock functions _could_ move out into a
     separate conditionally compiled file, but it's probably not worth it as
     there're so many common bits.

 (*) fs/nfs/namespace.c

     Some namespace-specific functions have been moved here.

 (*) fs/nfs/nfs4namespace.c

     NFS4-specific namespace functions (this could be merged into the previous
     file).  This file is conditionally compiled.

 (*) fs/nfs/internal.h

     Inter-file declarations, plus a few simple utility functions moved from
     fs/nfs/inode.c.

     Additionally, all the in-.c-file externs have been moved here, and those
     files they were moved from now includes this file.

For the most part, the functions have not been changed, only some multiplexor
functions have changed significantly.

I've also:

 (*) Added some extra banner comments above some functions.

 (*) Rearranged the function order within the files to be more logical and
     better grouped (IMO), though someone may prefer a different order.

 (*) Reduced the number of #ifdefs in .c files.

 (*) Added missing __init and __exit directives.

Signed-Off-By: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells authored and Trond Myklebust committed Jun 9, 2006
1 parent 4e5ccf6 commit f7b422b
Show file tree
Hide file tree
Showing 16 changed files with 1,993 additions and 1,802 deletions.
5 changes: 3 additions & 2 deletions fs/nfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

obj-$(CONFIG_NFS_FS) += nfs.o

nfs-y := dir.o file.o inode.o nfs2xdr.o pagelist.o \
nfs-y := dir.o file.o inode.o super.o nfs2xdr.o pagelist.o \
proc.o read.o symlink.o unlink.o write.o \
namespace.o
nfs-$(CONFIG_ROOT_NFS) += nfsroot.o mount_clnt.o
nfs-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o
nfs-$(CONFIG_NFS_V3_ACL) += nfs3acl.o
nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \
delegation.o idmap.o \
callback.o callback_xdr.o callback_proc.o
callback.o callback_xdr.o callback_proc.o \
nfs4namespace.o
nfs-$(CONFIG_NFS_DIRECTIO) += direct.o
nfs-$(CONFIG_SYSCTL) += sysctl.o
nfs-objs := $(nfs-y)
2 changes: 0 additions & 2 deletions fs/nfs/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp)
/*
* Define NFS4 callback program
*/
extern struct svc_version nfs4_callback_version1;

static struct svc_version *nfs4_callback_version[] = {
[1] = &nfs4_callback_version1,
};
Expand Down
6 changes: 3 additions & 3 deletions fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t
* nfs_init_directcache - create a slab cache for nfs_direct_req structures
*
*/
int nfs_init_directcache(void)
int __init nfs_init_directcache(void)
{
nfs_direct_cachep = kmem_cache_create("nfs_direct_cache",
sizeof(struct nfs_direct_req),
Expand All @@ -906,10 +906,10 @@ int nfs_init_directcache(void)
}

/**
* nfs_init_directcache - destroy the slab cache for nfs_direct_req structures
* nfs_destroy_directcache - destroy the slab cache for nfs_direct_req structures
*
*/
void nfs_destroy_directcache(void)
void __exit nfs_destroy_directcache(void)
{
if (kmem_cache_destroy(nfs_direct_cachep))
printk(KERN_INFO "nfs_direct_cache: not all structures were freed\n");
Expand Down
Loading

0 comments on commit f7b422b

Please sign in to comment.