Skip to content

NFS: Create NFS Modules

[email protected] linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest44 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/44NFS: ifndef guard internal.hfs/nfs/internal.h+4 -00 replies
2/44NFS: Relocate the stat_to_errno() functionfs/nfs/client.c fs/nfs/nfs2xdr.c+66 -640 replies
3/44NFS: Make v2 configurablefs/nfs/Kconfig fs/nfs/Makefile fs/nfs/client.c+22 -30 replies
4/44NFS: Add version registering frameworkfs/nfs/client.c fs/nfs/inode.c fs/nfs/nfs.h +1 more+216 -200 replies
5/44NFS: Move v2 to new subdirectoryfs/nfs/Makefile fs/nfs/nfs2/proc.c fs/nfs/nfs2/xdr.c+3 -30 replies
6/44NFS: Export symbols needed by a v2 modulefs/nfs/client.c fs/nfs/dir.c fs/nfs/file.c +2 more+78 -420 replies
7/44NFS: Convert NFS v2 into a modulefs/nfs/Kconfig fs/nfs/Makefile fs/nfs/client.c +8 more+134 -240 replies
8/44NFS: Created custom init_aclclient() functionsfs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs2/Makefile +3 more+29 -60 replies
9/44NFS: Move v3 to its own subdirectoryfs/nfs/Makefile fs/nfs/nfs3/acl.c fs/nfs/nfs3/proc.c +1 more+6 -60 replies
10/44NFS: Export symbols needed by a v3 modulefs/nfs/dir.c fs/nfs/inode.c+4 -00 replies
11/44NFS: Switch to using the IS_ENABLED macro for CONFIG_NFS_V3fs/nfs/client.c fs/nfs/dir.c fs/nfs/direct.c +4 more+16 -160 replies
12/44NFS: Convert NFS v3 into a modulefs/nfs/Kconfig fs/nfs/Makefile fs/nfs/client.c +11 more+220 -840 replies
13/44NFS: Remove unused codefs/nfs/client.c fs/nfs/dir.c fs/nfs/file.c +1 more+0 -760 replies
14/44NFS: Move v4 to its own subdirectoryfs/nfs/Makefile fs/nfs/client.c fs/nfs/dir.c +23 more+44 -380 replies
15/44NFS: Move init_aclclient() into the v4 subdirectoryfs/nfs/Makefile fs/nfs/client.c fs/nfs/nfs4/client.c+16 -130 replies
16/44NFS: Create a version-specific do_submount() functionfs/nfs/client.c fs/nfs/namespace.c fs/nfs/nfs.h +4 more+37 -150 replies
17/44NFS: Added in a custom do_clone_mount() functionfs/nfs/client.c fs/nfs/namespace.c fs/nfs/nfs.h +4 more+33 -170 replies
18/44NFS: Give versions a custom have_delegation() functionfs/nfs/client.c fs/nfs/inode.c fs/nfs/nfs.h +5 more+25 -80 replies
19/44NFS: Give versions a custom have_delegated_attributes() functionfs/nfs/client.c fs/nfs/inode.c fs/nfs/nfs.h +5 more+28 -60 replies
20/44NFS: Give versions a custom return_delegation() functionfs/nfs/client.c fs/nfs/inode.c fs/nfs/nfs.h +6 more+16 -100 replies
21/44NFS: Add a function to run when shutting down a clientfs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs2/module.c +3 more+54 -370 replies
22/44NFS: Split nfs_fs_mount() into two functionsfs/nfs/super.c+48 -330 replies
23/44NFS: Create a custom try_mount() function for each versionfs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs2/module.c +3 more+20 -120 replies
24/44NFS: Create a separate valadet_text_mount_data() functionfs/nfs/super.c+26 -200 replies
25/44NFS: Create a custom validate_mount_data() functionfs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs2/module.c +3 more+23 -170 replies
26/44NFS: Create an idr_lock to protect the cb_idrfs/nfs/client.c+15 -110 replies
27/44NFS: Create a custom alloc_client() functionfs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs2/client.c +6 more+52 -190 replies
28/44NFS: Create a custom put_client() functionfs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs2/client.c +6 more+23 -10 replies
29/44NFS: Create the nfs4/module.c filefs/nfs/Makefile fs/nfs/client.c fs/nfs/inode.c +3 more+65 -550 replies
30/44NFS: Move over NFS v4 sysctlsfs/nfs/Makefile fs/nfs/nfs.h fs/nfs/nfs4/module.c +3 more+16 -550 replies
31/44NFS: Move v4 getroot code to the v4 directoryfs/nfs/Makefile fs/nfs/getroot.c fs/nfs/nfs.h +1 more+144 -1290 replies
32/44NFS: Move a v4 block from inode.cfs/nfs/Makefile fs/nfs/inode.c fs/nfs/nfs.h +1 more+31 -230 replies
33/44NFS: Move over the v4_file_operations structurefs/nfs/Makefile fs/nfs/file.c fs/nfs/nfs4/file.c+39 -330 replies
34/44NFS: Move v4-only functions from dir.cfs/nfs/Makefile fs/nfs/dir.c fs/nfs/nfs.h +1 more+335 -3280 replies
35/44NFS: Register the v4 filesystem type from nfs4/module.cfs/nfs/nfs4/module.c fs/nfs/nfs4/nfs4.h fs/nfs/super.c+10 -80 replies
36/44NFS: Export functions from super.cfs/nfs/nfs.h fs/nfs/super.c+64 -360 replies
37/44NFS: Move v4 super code to the nfs4/ directoryfs/nfs/Makefile fs/nfs/nfs4/super.c fs/nfs/super.c+732 -7250 replies
38/44NFS: Only initialize pnfs in the v4.x casefs/nfs/client.c fs/nfs/nfs.h fs/nfs/nfs4/client.c +2 more+71 -320 replies
39/44NFS: Create accessor functions for the nfs_client_list()fs/nfs/client.c fs/nfs/nfs.h+22 -60 replies
40/44NFS: Export functions from client.cfs/nfs/client.c fs/nfs/nfs.h+32 -130 replies
41/44NFS: Move v4 client.c code to nfs4/client.cfs/nfs/client.c fs/nfs/nfs4/client.c+617 -6320 replies
42/44NFS: Switch to using IS_ENABLED macro for CONFIG_NFS_V4fs/nfs/inode.c fs/nfs/internal.h fs/nfs/namespace.c +8 more+35 -280 replies
43/44NFS: Export functions needed by a v4 modulefs/nfs/client.c fs/nfs/dir.c fs/nfs/dns_resolve.c +6 more+29 -06 replies
44/44NFS: Convert NFS v4 into a modulefs/nfs/Kconfig fs/nfs/Makefile fs/nfs/inode.c +3 more+9 -180 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/44] NFS: Create NFS Modules

From: Bryan Schumaker <[email protected]>

This patch series turns NFS v2, v3 and v4 into loadable kernel modules that need to be loaded 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 move as much code as I needed to get everything to compile, so removing all the ifdefs will still require a bit more work. I'm hoping that this is a good start, however. Whenever I created a new file with copy and pasted code I copied the copyright line from the original file. If somebody else has the copyright let me know and I'll change the copyright line in a future version of these patches.

Parts of NFS 4.1 are still compiled into the generic client but other parts have migrated into the nfs4.ko module. Therefore, to use v4.1 you will need to run modprobe nfs4.

Patch Map
---------
- Patches 01 and 02 do basic preparations
- Patch 03 make NFS v2 a Kconfig option
- Patch 04 adds in the NFS version registering framework
- Patches 05 - 07 turn NFS v2 into a loadable module, note that v2 is directly compiled into nfs.ko until patch 07.
- Patches 08 - 12 do the setup and conversion of v3 into a loadable module with updates to the v2 module happening in patch 08. v3 isn't a module until patch 12.
- Patch 13 is a small cleanup patch to remove code that is no longer used once v2 and v3 are turned into modules.
- Patch 14 - 44 do the necessary preperations and conversion of v4 into a kernel module. Updates to the v2 and v3 modules happen througout the preparation patches. v4 is moved into its own subdirectory in patch 14 and I gradually move code over throughout the rest of the patches to avoid a huge "copy everything at once" patch. v4 is still compiled into nfs.ko until patch 44 is applied.

Is there a git diff shortcut for moving a large chunk of code from one file to another? Patch 37 and 41 move #ifdef CONFIG_NFS_V4 blocks into the nfs4/ subdirectory, but so much needed to be moved to keep everything bisectable that both patches are 1300+ lines. The patches leading up to both of these do the necessary work so I could cut and paste code without having to do much else to get it to compile.

I use a function pointer set in an nfs_subversion structure to determine if a v2, v3, or v4 implementation should be called in various places. Most of these function pointers had to be addid in places where NFS v4 did something slighly differently. I would eventually like to see if any of the function pointers can be removed by defining new nfs4 functions in any of the nfs4 structures (file_system_type, super_operations, inode_operations, ...).

Comments and suggestions are appreciated. Thanks!

- Bryan