X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/e7360642819e8083b5d11a88f428984a81aa3692..79bada538fd55e3686e1c73fe430c533c186f0da:/sys/vfs/nwfs/nwfs_vfsops.c diff --git a/sys/vfs/nwfs/nwfs_vfsops.c b/sys/vfs/nwfs/nwfs_vfsops.c index 75d6ef942e..07c3f51aca 100644 --- a/sys/vfs/nwfs/nwfs_vfsops.c +++ b/sys/vfs/nwfs/nwfs_vfsops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_vfsops.c,v 1.6.2.6 2001/10/25 19:18:54 dillon Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.10 2004/04/22 17:56:44 cpressey Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.16 2005/02/12 01:31:38 joerg Exp $ */ #include "opt_ncp.h" #ifndef NCP @@ -58,6 +58,8 @@ #include "nwfs_node.h" #include "nwfs_subr.h" +extern struct vnodeopv_entry_desc nwfs_vnodeop_entries[]; + int nwfs_debuglevel = 0; static int nwfs_version = NWFS_VERSION; @@ -67,8 +69,7 @@ SYSCTL_NODE(_vfs, OID_AUTO, nwfs, CTLFLAG_RW, 0, "Netware file system"); SYSCTL_INT(_vfs_nwfs, OID_AUTO, version, CTLFLAG_RD, &nwfs_version, 0, ""); SYSCTL_INT(_vfs_nwfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nwfs_debuglevel, 0, ""); -static int nwfs_mount(struct mount *, char *, caddr_t, - struct nameidata *, struct thread *); +static int nwfs_mount(struct mount *, char *, caddr_t, struct thread *); static int nwfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); static int nwfs_root(struct mount *, struct vnode **); static int nwfs_start(struct mount *, int, struct thread *); @@ -141,11 +142,9 @@ nwfs_initnls(struct nwmount *nmp) { * data - addr in user space of mount params */ static int -nwfs_mount(struct mount *mp, char *path, caddr_t data, - struct nameidata *ndp, struct thread *td) +nwfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) { struct nwfs_args args; /* will hold data from mount request */ - size_t size; int error; struct nwmount *nmp = NULL; struct ncp_conn *conn = NULL; @@ -201,8 +200,6 @@ 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); @@ -218,6 +215,9 @@ nwfs_mount(struct mount *mp, char *path, caddr_t data, } /* protect against invalid mount points */ nmp->m.mount_point[sizeof(nmp->m.mount_point)-1] = '\0'; + + vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, nwfs_vnodeop_entries); + vfs_getnewfsid(mp); error = nwfs_root(mp, &vp); if (error) @@ -225,7 +225,7 @@ nwfs_mount(struct mount *mp, char *path, caddr_t data, /* * Lose the lock but keep the ref. */ - VOP_UNLOCK(vp, NULL, 0, curthread); + VOP_UNLOCK(vp, 0, curthread); NCPVODEBUG("rootvp.vrefcnt=%d\n",vp->v_usecount); return error; bad: @@ -291,7 +291,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) conn = NWFSTOCONN(nmp); if (nmp->n_root) { *vpp = NWTOV(nmp->n_root); - while (vget(*vpp, NULL, LK_EXCLUSIVE, curthread) != 0) /* XXX */ + while (vget(*vpp, LK_EXCLUSIVE, curthread) != 0) /* XXX */ ; return 0; } @@ -460,7 +460,6 @@ nwfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) sbp->f_fsid = mp->mnt_stat.f_fsid; /* file system id */ sbp->f_owner = mp->mnt_stat.f_owner; /* user that mounted the filesystem */ sbp->f_type = mp->mnt_vfc->vfc_typenum; /* type of filesystem */ - bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN); bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN); } strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN); @@ -494,8 +493,9 @@ loop: if (VOP_ISLOCKED(vp, NULL) || TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY) continue; - if (vget(vp, NULL, LK_EXCLUSIVE, td)) + if (vget(vp, LK_EXCLUSIVE, td)) goto loop; + /* XXX vp may not be retained */ error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error;