Skip to content

nfsd: Cleanup nfsd/pnfsd headers and code placment

Boaz Harrosh linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5sunrpc: Clean never used include filesinclude/linux/sunrpc/debug.h+0 -32 replies
2/5nfsd: Fix independence of a few nfsd related headersinclude/linux/nfs_xdr.h include/linux/nfsacl.h include/linux/posix_acl.h+3 -022 replies
3/5nfsd: Fix independence of linux/nfsd/ headersinclude/linux/nfsd/cache.h include/linux/nfsd/nfs4layoutxdr.h include/linux/nfsd/nfsfh.h +2 more+6 -00 replies
4/5SQUASHME pnfsd: Move pnfsd code out of nfs4state.c/hfs/nfsd/export.c fs/nfsd/nfs4callback.c fs/nfsd/nfs4pnfsd.c +6 more+246 -2021 reply
5/5nfsd: Remove lots of un-needed includesfs/exportfs/nfs4filelayoutxdr.c fs/nfsd/export.c fs/nfsd/nfs4callback.c +5 more+0 -920 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCHSET 0/5] nfsd: Cleanup nfsd/pnfsd headers and code placment

In motivation to better organize pnfs code and have minimal impact on the rest of the nfsd code-base, I've done some cleanups and code movements. The begging of which was done by Andy in the last round.

The first needed thing was to re-introduce some sense into nfsd headers. I've taken all include/linux/nfsd/*.h files, one by one, and included them as first header in a .c file. Then fixed any missing includes from that header.

Here is current state after this patchset:

// Still BAD

#include <linux/nfsd/const.h> 
	/* NEEDS #include <linux/types.h> in linux/sunrpc/msg_prot.h */
#include <linux/nfsd/export.h> 
	/* NEEDS #include <linux/nfsd/nfsfh.h> */

#include <linux/nfsd/syscall.h> /* Broken because of export.h above */

[Should I fix those too?]

// GOOD or fixed
#include <linux/nfsd/cache.h>
#include <linux/nfsd/debug.h>
#include <linux/nfsd/nfs4layoutxdr.h>
#include <linux/nfsd/nfs4pnfsdlm.h>
#include <linux/nfsd/nfsd4_pnfs.h>
#include <linux/nfsd/nfsd.h>
#include <linux/nfsd/nfsfh.h>
#include <linux/nfsd/pnfsd.h>
#include <linux/nfsd/state.h>
#include <linux/nfsd/stats.h>
#include <linux/nfsd/xdr.h>
#include <linux/nfsd/xdr3.h>
#include <linux/nfsd/xdr4.h>

I then proceeded to re-arrange some pnfs code/definitions into pnfsd specific files.

And finally all files thouched in this round where include-cleaned

Here are the list of patches:

[PATCH 1/5] sunrpc: Clean never used include files

This one is for Trond, include-cleaning

[PATCH 2/5] nfsd: Fix independence of a few nfsd related headers [PATCH 3/5] nfsd: Fix independence of linux/nfsd/ headers

These two fix nfsd headers independence. As explained above. (Should I squash these together)

[PATCH 4/5] SQUASHME pnfsd: Move pnfsd code out of nfs4state.c/h

Now it is much easier to do this one.

[PATCH 5/5] nfsd: Remove lots of un-needed includes

And some more include-cleaning

TODO: Some more of above magic done to more nfsd files

Thanks
Boaz