From b3c805a899bc1bf721470e47dacd778e2dd77842 Mon Sep 17 00:00:00 2001 From: rodrigc Date: Wed, 5 Mar 2008 09:41:22 +0000 Subject: In nfs_mount(), default initialize struct nfs_args the same way that it is default initialized in revision 1.77 of mount_nfs.c. Right now, this is a no-op, because currently we initialize struct nfs_args in mount_nfs in userspace, and pass it down into the kernel via nmount(), so we overwrite whatever we initialize here with the value passed in from userspace. However, this lays the groundwork for moving away from passing struct nfs_args from userspace to kernel via nmount(), so that we can instead pass string mount options via nmount() which can be parsed in the kernel. This will make it easier to add new NFS mount options. --- sys/nfsclient/nfs_vfsops.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 1353871..eddf478 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -719,8 +719,32 @@ static const char *nfs_opts[] = { "from", "nfs_args", static int nfs_mount(struct mount *mp, struct thread *td) { + struct nfs_args args = { + .version = NFS_ARGSVERSION, + .addr = NULL, + .addrlen = sizeof (struct sockaddr_in), + .sotype = SOCK_STREAM, + .proto = 0, + .fh = NULL, + .fhsize = 0, + .flags = NFSMNT_RESVPORT, + .wsize = NFS_WSIZE, + .rsize = NFS_RSIZE, + .readdirsize = NFS_READDIRSIZE, + .timeo = 10, + .retrans = NFS_RETRANS, + .maxgrouplist = NFS_MAXGRPS, + .readahead = NFS_DEFRAHEAD, + .wcommitsize = 0, /* was: NQ_DEFLEASE */ + .deadthresh = NFS_MAXDEADTHRESH, /* was: NQ_DEADTHRESH */ + .hostname = NULL, + /* args version 4 */ + .acregmin = NFS_MINATTRTIMO, + .acregmax = NFS_MAXATTRTIMO, + .acdirmin = NFS_MINDIRATTRTIMO, + .acdirmax = NFS_MAXDIRATTRTIMO, + }; int error; - struct nfs_args args; struct sockaddr *nam; struct vnode *vp; char hst[MNAMELEN]; -- cgit v1.1