NFS: Create NFS Modules
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest23 patches 4 repliesIn review
- v1 RFC21 patches 4 repliesSuperseded
Changes in v4 from the cover letter
-------------
- Use request_module to load modules
- Correct Makefile for $(CONFIG_NFS_V3_ACL)
- Various compiler errors found while changing CONFIG_NFS_* values
- Fix dependency cycle with NFS v4.1 enabled
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/23 | NFS: Relocate the stat_to_errno() functionfs/ fs/ | +66 | 0 replies | |
| 2/23 | NFS: Make v2 configurablefs/ fs/ fs/ | +22 | 0 replies | |
| 3/23 | NFS: Add version registering frameworkfs/ fs/ fs/ +17 more | +280 | 4 replies | |
| 4/23 | NFS: Convert v2 into a modulefs/ fs/ fs/ +5 more | +34 | 0 replies | |
| 5/23 | NFS: Break up the nfs_fs_mount functionfs/ fs/ fs/ +4 more | +96 | 0 replies | |
| 6/23 | NFS: Create a single nfs_clone_super() functionfs/ | +7 | 0 replies | |
| 7/23 | NFS: Version specific xdev mountingfs/ fs/ fs/ +3 more | +56 | 0 replies | |
| 8/23 | NFS: Only initialize the ACL client in the v3 casefs/ fs/ fs/ +5 more | +88 | 0 replies | |
| 9/23 | NFS: Convert v3 into a modulefs/ fs/ fs/ +11 more | +108 | 0 replies | |
| 10/23 | NFS: Initialize NFS v4 from nfs4super.cfs/ fs/ fs/ +5 more | +57 | 0 replies | |
| 11/23 | NFS: Move lots of code from super.cfs/ fs/ fs/ | +625 | 0 replies | |
| 12/23 | NFS: module-specific submount functionfs/ fs/ fs/ +5 more | +61 | 0 replies | |
| 13/23 | NFS: Custom alloc and free client functions for modulesfs/ fs/ fs/ +5 more | +127 | 0 replies | |
| 14/23 | NFS: Move nfs4_set_client() and support code to nfs4client.cfs/ fs/ fs/ | +356 | 0 replies | |
| 15/23 | NFS: Move the nfs4_init_client() to nfs4client.cfs/ fs/ fs/ | +132 | 0 replies | |
| 16/23 | NFS: Move the v4 getroot code to nfs4getroot.cfs/ fs/ fs/ +1 more | +141 | 0 replies | |
| 17/23 | NFS: Deal with delegationsfs/ fs/ fs/ +6 more | +57 | 0 replies | |
| 18/23 | NFS: Create a v4-specific fsync functionfs/ fs/ fs/ +2 more | +105 | 0 replies | |
| 19/23 | NFS: Create custom NFS v4 write_inode() functionfs/ fs/ | +20 | 0 replies | |
| 20/23 | NFS: Create custom init_read() and init_write() functionsfs/ fs/ fs/ +7 more | +36 | 0 replies | |
| 21/23 | NFS: Give modules a custom set / unset layoutdriver functionsfs/ fs/ fs/ +2 more | +32 | 0 replies | |
| 22/23 | NFS: Use the IS_ENABLED macro for CONFIG_NFS_V4fs/ fs/ fs/ +13 more | +42 | 0 replies | |
| 23/23 | NFS: Convert v4 into a modulefs/ fs/ fs/ +14 more | +95 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 00/23] NFS: Create NFS Modules
From: Bryan Schumaker <[email protected]>
This patch series turns NFS v2, v3 and v4 into loadable kernel modules that are requested before using. This should eventually help clean up all of the NFS code by giving us a chance to remove most of the ifdefs that check for CONFIG_NFS_V3 and CONFIG_NFS_V4.
I have tried to move as little code as possible while making these patches since version specific code can be moved later once the basic framework has been merged and tested. I still had to move a large chunk of code out of super.c and into nfs4super.c, but the other files are mostly untouched.
Initial size (without v4.1):
584 nfs.ko (without v4.1)
Final sizes (without v4.1):
312 nfs.ko
44 nfs2.ko
68 nfs3.ko
264 nfs4.ko
Initial size (with v4.1):
708 nfs.ko
Final sizes (with v4.1):
316 nfs.ko
44 nfs2.ko
68 nfs3.ko
384 nfs4.ko
Patch Map
---------
- Patch 1 moves a function out of v2-specific code
- Patch 2 makes NFS v2 configurable
- Patch 3 adds the modules framework
- Patch 4 makes NFS v2 an optional kernel module
- Patches 5 - 9 make NFS v3 an optional kernel module
- Patches 10 - 24 make NFS v4 an optional kernel module
Changes in v4
-------------
- Use request_module to load modules
- Correct Makefile for $(CONFIG_NFS_V3_ACL)
- Various compiler errors found while changing CONFIG_NFS_* values
- Fix dependency cycle with NFS v4.1 enabled
Known bug
---------
I found that if 2 - 3 threads all try to mount NFS v4 at almost the exact same time then try_then_request_module() will sometimes return success before the nfs4.ko module is fully initialized. This leads to get_nfs_version() returning -EPROTONOSUPPORT to one thread (the others are all able to use v4 without a problem). Doing schedule() then try_then_request_module() a second time seems to fix the problem, but that feels more like a workaround than a real fix.
I've left it out for now with hope that there is a better way to handle this. For my own testing, I've started doing modprobe nfs4 before mounting anything using NFS 4.
Comments and suggestions are appreciated. Thanks!
- Bryan
Bryan Schumaker (23):
NFS: Relocate the stat_to_errno() function
NFS: Make v2 configurable
NFS: Add version registering framework
NFS: Convert v2 into a module
NFS: Break up the nfs_fs_mount function
NFS: Create a single nfs_clone_super() function
NFS: Version specific xdev mounting
NFS: Only initialize the ACL client in the v3 case
NFS: Convert v3 into a module
NFS: Initialize NFS v4 from nfs4super.c
NFS: Move lots of code from super.c
NFS: module-specific submount function
NFS: Custom alloc and free client functions for modules
NFS: Move nfs4_set_client() and support code to nfs4client.c
NFS: Move the nfs4_init_client() to nfs4client.c
NFS: Move the v4 getroot code to nfs4getroot.c
NFS: Deal with delegations
NFS: Create a v4-specific fsync function
NFS: Create custom NFS v4 write_inode() function
NFS: Create custom init_read() and init_write() functions
NFS: Give modules a custom set / unset layoutdriver functions
NFS: Use the IS_ENABLED macro for CONFIG_NFS_V4
NFS: Convert v4 into a module
fs/lockd/clnt4xdr.c | 2 +-
fs/lockd/clntxdr.c | 6 +-
fs/lockd/mon.c | 4 +-
fs/nfs/Kconfig | 13 +-
fs/nfs/Makefile | 25 +-
fs/nfs/callback.h | 2 +-
fs/nfs/client.c | 799 ++++++++-----------------------
fs/nfs/delegation.c | 8 +-
fs/nfs/delegation.h | 11 +-
fs/nfs/dir.c | 77 ++-
fs/nfs/direct.c | 2 +-
fs/nfs/dns_resolve.c | 3 +
fs/nfs/file.c | 114 ++---
fs/nfs/fscache.c | 3 +
fs/nfs/getroot.c | 136 +-----
fs/nfs/inode.c | 72 +--
fs/nfs/internal.h | 19 +-
fs/nfs/mount_clnt.c | 6 +-
fs/nfs/namespace.c | 59 +--
fs/nfs/netns.h | 2 +-
fs/nfs/nfs.h | 147 ++++++
fs/nfs/nfs2super.c | 92 ++++
fs/nfs/nfs2xdr.c | 66 +--
fs/nfs/nfs3client.c | 75 +++
fs/nfs/nfs3super.c | 123 +++++
fs/nfs/nfs3xdr.c | 4 +-
fs/nfs/nfs4_fs.h | 24 +-
fs/nfs/nfs4client.c | 543 +++++++++++++++++++++
fs/nfs/nfs4file.c | 57 +++
fs/nfs/nfs4getroot.c | 135 ++++++
fs/nfs/nfs4namespace.c | 11 +
fs/nfs/nfs4proc.c | 8 +-
fs/nfs/nfs4super.c | 703 +++++++++++++++++++++++++++
fs/nfs/{sysctl.c => nfs4sysctl.c} | 43 +-
fs/nfs/nfs4xdr.c | 2 +-
fs/nfs/pagelist.c | 3 +
fs/nfs/pnfs.c | 16 +-
fs/nfs/pnfs.h | 13 +-
fs/nfs/read.c | 8 +-
fs/nfs/super.c | 938 ++++++-------------------------------
fs/nfs/sysctl.c | 26 -
fs/nfs/unlink.c | 3 +-
fs/nfs/write.c | 36 +-
fs/nfsd/nfs4callback.c | 2 +-
include/linux/lockd/xdr4.h | 2 +-
include/linux/nfs_fs.h | 10 +-
include/linux/nfs_fs_sb.h | 6 +-
include/linux/nfs_idmap.h | 2 +-
include/linux/nfs_xdr.h | 12 +-
include/linux/sunrpc/clnt.h | 2 +-
net/sunrpc/rpcb_clnt.c | 8 +-
51 files changed, 2530 insertions(+), 1953 deletions(-)
create mode 100644 fs/nfs/dangling.txt
create mode 100644 fs/nfs/nfs.h
create mode 100644 fs/nfs/nfs2super.c
create mode 100644 fs/nfs/nfs3client.c
create mode 100644 fs/nfs/nfs3super.c
create mode 100644 fs/nfs/nfs4client.c
create mode 100644 fs/nfs/nfs4file.c
create mode 100644 fs/nfs/nfs4getroot.c
create mode 100644 fs/nfs/nfs4super.c
copy fs/nfs/{sysctl.c => nfs4sysctl.c} (51%)Signature · 1 line
1.7.9.4