From 401895533496c6f7943c0cadf487c2cfa8f852ac Mon Sep 17 00:00:00 2001 From: adrian Date: Thu, 1 Mar 2001 21:00:17 +0000 Subject: Reviewed by: jlemon An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount. --- sys/fs/nwfs/nwfs_vfsops.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'sys/fs/nwfs') diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c index 3e76b30..7d17e7d 100644 --- a/sys/fs/nwfs/nwfs_vfsops.c +++ b/sys/fs/nwfs/nwfs_vfsops.c @@ -146,7 +146,6 @@ static int nwfs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, struct proc *p) { struct nwfs_args args; /* will hold data from mount request */ - size_t size; int error; struct nwmount *nmp = NULL; struct ncp_conn *conn = NULL; @@ -198,8 +197,6 @@ static int nwfs_mount(struct mount *mp, char *path, caddr_t data, nmp->m.dir_mode = (nmp->m.dir_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFDIR; if ((error = nwfs_initnls(nmp)) != 0) goto bad; - (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); - bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); pc = mp->mnt_stat.f_mntfromname; pe = pc+sizeof(mp->mnt_stat.f_mntfromname); bzero(pc, MNAMELEN); -- cgit v1.1