X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/4faddc0132d70ccaa104372c58830ef4d1304bd2..79bada538fd55e3686e1c73fe430c533c186f0da:/sys/vfs/nwfs/nwfs_vfsops.c diff --git a/sys/vfs/nwfs/nwfs_vfsops.c b/sys/vfs/nwfs/nwfs_vfsops.c index 867e1ebf72..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.9 2004/03/01 06:33:22 dillon 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 *); @@ -140,11 +141,10 @@ nwfs_initnls(struct nwmount *nmp) { * mp - path - addr in user space of mount point (ie /usr or whatever) * 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) +static int +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; @@ -200,8 +200,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); @@ -217,6 +215,9 @@ static int 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) @@ -224,7 +225,7 @@ static int 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: @@ -271,7 +272,8 @@ nwfs_unmount(struct mount *mp, int mntflags, struct thread *td) /* Return locked vnode to root of a filesystem */ static int -nwfs_root(struct mount *mp, struct vnode **vpp) { +nwfs_root(struct mount *mp, struct vnode **vpp) +{ struct vnode *vp; struct nwmount *nmp; struct nwnode *np; @@ -289,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; } @@ -371,10 +373,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) { */ /* ARGSUSED */ static int -nwfs_start(mp, flags, td) - struct mount *mp; - int flags; - struct thread *td; +nwfs_start(struct mount *mp, int flags, struct thread *td) { NCPVODEBUG("flags=%04x\n",flags); return (0); @@ -385,12 +384,8 @@ nwfs_start(mp, flags, td) */ /* ARGSUSED */ static int -nwfs_quotactl(mp, cmd, uid, arg, td) - struct mount *mp; - int cmd; - uid_t uid; - caddr_t arg; - struct thread *td; +nwfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, + struct thread *td) { NCPVODEBUG("return EOPNOTSUPP\n"); return (EOPNOTSUPP); @@ -430,10 +425,7 @@ nwfs_uninit(struct vfsconf *vfsp) * nwfs_statfs call */ int -nwfs_statfs(mp, sbp, td) - struct mount *mp; - struct statfs *sbp; - struct thread *td; +nwfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) { struct nwmount *nmp = VFSTONWFS(mp); int error = 0, secsize; @@ -468,7 +460,6 @@ nwfs_statfs(mp, sbp, 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); @@ -480,10 +471,7 @@ nwfs_statfs(mp, sbp, td) */ /* ARGSUSED */ static int -nwfs_sync(mp, waitfor, td) - struct mount *mp; - int waitfor; - struct thread *td; +nwfs_sync(struct mount *mp, int waitfor, struct thread *td) { struct vnode *vp; int error, allerror = 0; @@ -505,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;