History

NFS: Add fs_context support.

Add filesystem context support to NFS, parsing the options in advance and attaching the information to struct nfs_fs_context. The highlights are: (*) Merge nfs_mount_info and nfs_clone_mount into nfs_fs_context. This structure represents NFS's superblock config. (*) Make use of the VFS's parsing support to split comma-separated lists (*) Pin the NFS protocol module in the nfs_fs_context. (*) Attach supplementary error information to fs_context. This has the downside that these strings must be static and can't be formatted. (*) Remove the auxiliary file_system_type structs since the information necessary can be conveyed in the nfs_fs_context struct instead. (*) Root mounts are made by duplicating the config for the requested mount so as to have the same parameters. Submounts pick up their parameters from the parent superblock. [AV -- retrans is u32, not string] [SM -- Renamed cfg to ctx in a few functions in an earlier patch] [SM -- Moved fs_context mount option parsing to an earlier patch] [SM -- Moved fs_context error logging to a later patch] [SM -- Fixed printks in nfs4_try_get_tree() and nfs4_get_referral_tree()] [SM -- Added is_remount_fc() helper] [SM -- Deferred some refactoring to a later patch] [SM -- Fixed referral mounts, which were broken in the original patch] [SM -- Fixed leak of nfs_fattr when fs_context is freed]

David Howells committed 6 years ago

Commit f2aedb71 parent e38bb2312 files · +773 −659Browse files

Showing the changes to include/linux (1 of 12 files). Show all

Unified · Split

include/linux/nfs_xdr.h+3−3
@@ -1639,6 +1639,7 @@ struct nfs_subversion; · 1638 unmodified lines
1639struct nfs_mount_info;1639struct nfs_mount_info;
1640struct nfs_client_initdata;1640struct nfs_client_initdata;
1641struct nfs_pageio_descriptor;1641struct nfs_pageio_descriptor;
1642struct fs_context;
1642 1643
1643/*1644/*
1644 * RPC procedure vector for NFSv2/NFSv3 demuxing1645 * RPC procedure vector for NFSv2/NFSv3 demuxing
@@ -1653,9 +1654,8 @@ struct nfs_rpc_ops { · 8 unmodified lines
1653 1654
1654 int (*getroot) (struct nfs_server *, struct nfs_fh *,1655 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1655 struct nfs_fsinfo *);1656 struct nfs_fsinfo *);
1656 struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,1657 int (*submount) (struct fs_context *, struct nfs_server *);
1657 struct nfs_fh *, struct nfs_fattr *);1658 int (*try_get_tree) (struct fs_context *);
1658 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *);
1659 int (*getattr) (struct nfs_server *, struct nfs_fh *,1659 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1660 struct nfs_fattr *, struct nfs4_label *,1660 struct nfs_fattr *, struct nfs4_label *,
1661 struct inode *);1661 struct inode *);