Skip to content

Commit

Permalink
nfsd: Headers Independence and include cleanups
Browse files Browse the repository at this point in the history
* Add includes that are directly used by headers
* Remove includes that are not needed

These are the changes made:

[xdr.h]
struct nfsd_readdirres has an embedded struct readdir_cd from nfsd.h
fixing that we can drop other includes

[xdr4.h]
embedded types defined both at state.h and nfsd.h

[syscall.h]
After export.h fix none of these stuff is needed.
fix extra space in # include <> statement

[stats.h]
does not need <linux/nfs4.h> but was export to user-mode
so I don't touch it

[state.h]
embedded types from nfsfh.h like struct knfsd_fh. bringing that
eliminates the need for all other includes

[nfsfh.h]
directly manipulating types from sunrpc/svc.h.
Removed Other unused headers.

[nfsd.h]
removed unused headers include

[export.h]
lots of sunrpc/svc.h types and a single prototype declaration
with pointer from nfsfh.h, but all users of export.h do need
nfsfh.h any way. remove now un-needed include.

[const.h]
Unfixed (not independent)

[cache.h]
could do with a forward declaration of "struct svc_rqst;"
from sunrpc/svc.h but all users absolutely will need
sunrpc/svc.h it is easier overall this way.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
Boaz Harrosh authored and J. Bruce Fields committed Dec 14, 2009
1 parent d703158 commit 72579ac
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
3 changes: 1 addition & 2 deletions include/linux/nfsd/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#ifndef NFSCACHE_H
#define NFSCACHE_H

#include <linux/in.h>
#include <linux/uio.h>
#include <linux/sunrpc/svc.h>

/*
* Representation of a reply cache entry.
Expand Down
2 changes: 1 addition & 1 deletion include/linux/nfsd/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# include <linux/types.h>
#ifdef __KERNEL__
# include <linux/in.h>
# include <linux/nfsd/nfsfh.h>
#endif

/*
Expand Down
4 changes: 0 additions & 4 deletions include/linux/nfsd/nfsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@
#define LINUX_NFSD_NFSD_H

#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/fs.h>
#include <linux/posix_acl.h>
#include <linux/mount.h>

#include <linux/nfsd/debug.h>
#include <linux/nfsd/nfsfh.h>
#include <linux/nfsd/export.h>
#include <linux/nfsd/stats.h>
/*
Expand Down
3 changes: 1 addition & 2 deletions include/linux/nfsd/nfsfh.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

# include <linux/types.h>
#ifdef __KERNEL__
# include <linux/string.h>
# include <linux/fs.h>
# include <linux/sunrpc/svc.h>
#endif
#include <linux/nfsd/const.h>

Expand Down
4 changes: 1 addition & 3 deletions include/linux/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
#ifndef _NFSD4_STATE_H
#define _NFSD4_STATE_H

#include <linux/list.h>
#include <linux/kref.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfsd/nfsfh.h>

typedef struct {
u32 cl_boot;
Expand Down
8 changes: 1 addition & 7 deletions include/linux/nfsd/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@
#ifndef NFSD_SYSCALL_H
#define NFSD_SYSCALL_H

# include <linux/types.h>
#ifdef __KERNEL__
# include <linux/in.h>
#endif
#include <linux/posix_types.h>
#include <linux/nfsd/const.h>
#include <linux/types.h>
#include <linux/nfsd/export.h>
#include <linux/nfsd/nfsfh.h>

/*
* Version of the syscall interface
Expand Down
3 changes: 1 addition & 2 deletions include/linux/nfsd/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
#ifndef LINUX_NFSD_H
#define LINUX_NFSD_H

#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/nfs.h>
#include <linux/nfsd/nfsd.h>

struct nfsd_fhandle {
struct svc_fh fh;
Expand Down
3 changes: 2 additions & 1 deletion include/linux/nfsd/xdr4.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
#ifndef _LINUX_NFSD_XDR4_H
#define _LINUX_NFSD_XDR4_H

#include <linux/nfs4.h>
#include <linux/nfsd/state.h>
#include <linux/nfsd/nfsd.h>

#define NFSD4_MAX_TAGLEN 128
#define XDR_LEN(n) (((n) + 3) & ~3)
Expand Down

0 comments on commit 72579ac

Please sign in to comment.