From: Chuck Lever Add some data structures and definitions to support parsing NFS mount options in the kernel NFS client. Signed-off-by: Chuck Lever Cc: Trond Myklebust Cc: "J. Bruce Fields" Signed-off-by: Andrew Morton --- fs/nfs/super.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 79 insertions(+) diff -puN fs/nfs/super.c~nfs-new-infrastructure-for-nfs-client-in-kernel-mount-option-parsing fs/nfs/super.c --- a/fs/nfs/super.c~nfs-new-infrastructure-for-nfs-client-in-kernel-mount-option-parsing +++ a/fs/nfs/super.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -57,6 +58,84 @@ #define NFSDBG_FACILITY NFSDBG_VFS + +struct nfs_mount_args { + struct nfs_mount_data nmd; + unsigned int nfsprog; + unsigned use_mnthost; + struct sockaddr_in mnthost; + unsigned int mntprog; + unsigned int mntvers; + unsigned short mntport; +}; + +struct nfs4_mount_args { + struct nfs4_mount_data nmd; + struct sockaddr_in addr; + char clientaddr[16]; + int authflavor; +}; + +enum { + /* Mount options that take no arguments */ + Opt_soft, Opt_hard, + Opt_intr, Opt_nointr, + Opt_posix, Opt_noposix, + Opt_cto, Opt_nocto, + Opt_ac, Opt_noac, + Opt_lock, Opt_nolock, + Opt_v2, Opt_v3, + Opt_udp, Opt_tcp, + Opt_acl, Opt_noacl, + + /* Mount options that take integer arguments */ + Opt_port, + Opt_rsize, Opt_wsize, + Opt_timeo, Opt_retrans, + Opt_acregmin, Opt_acregmax, + Opt_acdirmin, Opt_acdirmax, + Opt_actimeo, + Opt_namelen, + Opt_mountport, + Opt_mountprog, Opt_mountvers, + Opt_nfsprog, Opt_nfsvers, + + /* Mount options that take string arguments */ + Opt_sec, Opt_proto, Opt_addr, + Opt_mounthost, Opt_clientaddr, Opt_context, + + /* Mount options that are ignored */ + Opt_userspace, Opt_deprecated, + + Opt_err, +}; + +enum { + Opt_sec_none, Opt_sec_sys, + Opt_sec_krb5, Opt_sec_krb5i, Opt_sec_krb5p, + Opt_sec_lkey, Opt_sec_lkeyi, Opt_sec_lkeyp, + Opt_sec_spkm, Opt_sec_spkmi, Opt_sec_spkmp, + + Opt_sec_err, +}; + +static match_table_t nfs_sec_tokens = { + {Opt_sec_none, "none"}, + {Opt_sec_none, "null"}, + {Opt_sec_sys, "sys"}, + + {Opt_sec_krb5, "krb5"}, + {Opt_sec_krb5i, "krb5i"}, + {Opt_sec_krb5p, "krb5p"}, + + {Opt_sec_lkey, "lkey"}, + {Opt_sec_lkeyi, "lkeyi"}, + {Opt_sec_lkeyp, "lkeyp"}, + + {Opt_sec_err, NULL}, +}; + + static void nfs_umount_begin(struct vfsmount *, int); static int nfs_statfs(struct dentry *, struct kstatfs *); static int nfs_show_options(struct seq_file *, struct vfsmount *); _