diff options
Diffstat (limited to 'sys/fs/hpfs')
-rw-r--r-- | sys/fs/hpfs/hpfs.h | 2 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_hash.c | 6 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 80 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vnops.c | 42 |
4 files changed, 68 insertions, 62 deletions
diff --git a/sys/fs/hpfs/hpfs.h b/sys/fs/hpfs/hpfs.h index f354b6b..f0253d5 100644 --- a/sys/fs/hpfs/hpfs.h +++ b/sys/fs/hpfs/hpfs.h @@ -417,7 +417,7 @@ void hpfs_hphashinit __P((void)); void hpfs_hphashdestroy __P((void)); struct hpfsnode *hpfs_hphashlookup __P((dev_t, lsn_t)); struct hpfsnode *hpfs_hphashget __P((dev_t, lsn_t)); -struct vnode *hpfs_hphashvget __P((dev_t, lsn_t, struct proc *)); +struct vnode *hpfs_hphashvget __P((dev_t, lsn_t, struct thread *)); void hpfs_hphashins __P((register struct hpfsnode *)); void hpfs_hphashrem __P((register struct hpfsnode *)); extern struct lock hpfs_hphash_lock; diff --git a/sys/fs/hpfs/hpfs_hash.c b/sys/fs/hpfs/hpfs_hash.c index 791680c..fd8eeca 100644 --- a/sys/fs/hpfs/hpfs_hash.c +++ b/sys/fs/hpfs/hpfs_hash.c @@ -123,10 +123,10 @@ loop: #endif struct vnode * -hpfs_hphashvget(dev, ino, p) +hpfs_hphashvget(dev, ino, td) dev_t dev; lsn_t ino; - struct proc *p; + struct thread *td; { struct hpfsnode *hp; struct vnode *vp; @@ -138,7 +138,7 @@ loop: vp = HPTOV(hp); mtx_lock(&vp->v_interlock); mtx_unlock(&hpfs_hphash_mtx); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, p)) + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) goto loop; return (vp); } diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 46e197d..e83f356 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -64,37 +64,37 @@ MALLOC_DEFINE(M_HPFSNO, "HPFS node", "HPFS node structure"); static int hpfs_root __P((struct mount *, struct vnode **)); static int hpfs_statfs __P((struct mount *, struct statfs *, - struct proc *)); -static int hpfs_unmount __P((struct mount *, int, struct proc *)); + struct thread *)); +static int hpfs_unmount __P((struct mount *, int, struct thread *)); static int hpfs_vget __P((struct mount *mp, ino_t ino, struct vnode **vpp)); static int hpfs_mountfs __P((register struct vnode *, struct mount *, - struct hpfs_args *, struct proc *)); + struct hpfs_args *, struct thread *)); static int hpfs_vptofh __P((struct vnode *, struct fid *)); static int hpfs_fhtovp __P((struct mount *, struct fid *, struct vnode **)); #if !defined(__FreeBSD__) static int hpfs_quotactl __P((struct mount *, int, uid_t, caddr_t, - struct proc *)); -static int hpfs_start __P((struct mount *, int, struct proc *)); + struct lwp *)); +static int hpfs_start __P((struct mount *, int, struct lwp *)); static int hpfs_sync __P((struct mount *, int, struct ucred *, - struct proc *)); + struct lwp *)); #endif #if defined(__FreeBSD__) struct sockaddr; static int hpfs_mount __P((struct mount *, char *, caddr_t, - struct nameidata *, struct proc *)); + struct nameidata *, struct thread *)); static int hpfs_init __P((struct vfsconf *)); static int hpfs_uninit __P((struct vfsconf *)); #else /* defined(__NetBSD__) */ static int hpfs_mount __P((struct mount *, const char *, void *, - struct nameidata *, struct proc *)); + struct nameidata *, struct thread *)); static void hpfs_init __P((void)); static int hpfs_mountroot __P((void)); static int hpfs_sysctl __P((int *, u_int, void *, size_t *, void *, - size_t, struct proc *)); + size_t, struct thread *)); static int hpfs_checkexp __P((struct mount *, struct mbuf *, int *, struct ucred **)); #endif @@ -127,14 +127,14 @@ hpfs_checkexp(mp, nam, exflagsp, credanonp) #if !defined(__FreeBSD__) /*ARGSUSED*/ static int -hpfs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) +hpfs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, td) int *name; u_int namelen; void *oldp; size_t *oldlenp; void *newp; size_t newlen; - struct proc *p; + struct lwp *td; { return (EINVAL); } @@ -179,12 +179,14 @@ hpfs_mount ( #if defined(__FreeBSD__) char *path, caddr_t data, + struct nameidata *ndp, + struct thread *td ) #else /* defined(__NetBSD__) */ const char *path, void *data, -#endif struct nameidata *ndp, - struct proc *p ) + struct lwp *l ) +#endif { u_int size; int err = 0; @@ -237,7 +239,11 @@ hpfs_mount ( * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. */ - NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p); +#ifdef __FreeBSD__ + NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, td); +#else + NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, l); +#endif err = namei(ndp); if (err) { /* can't get devvp!*/ @@ -282,7 +288,7 @@ hpfs_mount ( &size); /* real size*/ bzero( mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); - err = hpfs_mountfs(devvp, mp, &args, p); + err = hpfs_mountfs(devvp, mp, &args, td); if (err) goto error_2; @@ -292,7 +298,7 @@ hpfs_mount ( * * This code is common to root and non-root mounts */ - (void)VFS_STATFS(mp, &mp->mnt_stat, p); + (void)VFS_STATFS(mp, &mp->mnt_stat, td); goto success; @@ -312,11 +318,11 @@ success: * Common code for mount and mountroot */ int -hpfs_mountfs(devvp, mp, argsp, p) +hpfs_mountfs(devvp, mp, argsp, td) register struct vnode *devvp; struct mount *mp; struct hpfs_args *argsp; - struct proc *p; + struct thread *td; { int error, ncount, ronly; struct sublock *sup; @@ -345,19 +351,19 @@ hpfs_mountfs(devvp, mp, argsp, p) return (EBUSY); #if defined(__FreeBSD__) - VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p); - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); - VOP__UNLOCK(devvp, 0, p); + VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); + error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0); + VOP__UNLOCK(devvp, 0, td); #else - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); + error = vinvalbuf(devvp, V_SAVE, td->td_proc->p_ucred, td, 0, 0); #endif if (error) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); - VOP__UNLOCK(devvp, 0, p); + VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, td); + VOP__UNLOCK(devvp, 0, td); if (error) return (error); @@ -443,7 +449,7 @@ failed: #else devvp->v_specflags &= ~SI_MOUNTEDON; #endif - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p); + (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, td); return (error); } @@ -452,7 +458,7 @@ static int hpfs_start ( struct mount *mp, int flags, - struct proc *p ) + struct lwp *td ) { return (0); } @@ -462,7 +468,7 @@ static int hpfs_unmount( struct mount *mp, int mntflags, - struct proc *p) + struct thread *td) { int error, flags, ronly; register struct hpfsmount *hpmp = VFSTOHPFS(mp); @@ -489,9 +495,9 @@ hpfs_unmount( hpmp->hpm_devvp->v_specflags &= ~SI_MOUNTEDON; #endif - vinvalbuf(hpmp->hpm_devvp, V_SAVE, NOCRED, p, 0, 0); + vinvalbuf(hpmp->hpm_devvp, V_SAVE, NOCRED, td, 0, 0); error = VOP_CLOSE(hpmp->hpm_devvp, ronly ? FREAD : FREAD|FWRITE, - NOCRED, p); + NOCRED, td); vrele(hpmp->hpm_devvp); @@ -527,7 +533,7 @@ static int hpfs_statfs( struct mount *mp, struct statfs *sbp, - struct proc *p) + struct thread *td) { struct hpfsmount *hpmp = VFSTOHPFS(mp); @@ -562,7 +568,7 @@ hpfs_sync ( struct mount *mp, int waitfor, struct ucred *cred, - struct proc *p) + struct lwp *td) { return (0); } @@ -573,7 +579,7 @@ hpfs_quotactl ( int cmds, uid_t uid, caddr_t arg, - struct proc *p) + struct lwp *td) { printf("hpfs_quotactl():\n"); return (EOPNOTSUPP); @@ -628,7 +634,7 @@ hpfs_vget( struct vnode *vp; struct hpfsnode *hp; struct buf *bp; - struct proc *p = curproc; /* XXX */ + struct thread *td = curthread; /* XXX */ int error; dprintf(("hpfs_vget(0x%x): ",ino)); @@ -637,7 +643,7 @@ hpfs_vget( hp = NULL; vp = NULL; - if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, p)) != NULL) { + if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, td)) != NULL) { dprintf(("hashed\n")); return (0); } @@ -686,14 +692,14 @@ hpfs_vget( hp->h_devvp = hpmp->hpm_devvp; VREF(hp->h_devvp); - error = VN_LOCK(vp, LK_EXCLUSIVE, p); + error = VN_LOCK(vp, LK_EXCLUSIVE, td); if (error) { vput(vp); return (error); } do { - if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, p)) != NULL) { + if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, td)) != NULL) { dprintf(("hashed2\n")); vput(vp); return (0); diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c index 0e2a4b7..e612a24 100644 --- a/sys/fs/hpfs/hpfs_vnops.c +++ b/sys/fs/hpfs/hpfs_vnops.c @@ -102,7 +102,7 @@ hpfs_fsync(ap) struct vnode *a_vp; struct ucred *a_cred; int a_waitfor; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -153,7 +153,7 @@ hpfs_ioctl ( caddr_t a_data; int a_fflag; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap) { register struct vnode *vp = ap->a_vp; @@ -465,7 +465,7 @@ hpfs_getattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -517,14 +517,14 @@ hpfs_setattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct hpfsnode *hp = VTOHP(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; int error; dprintf(("hpfs_setattr(0x%x):\n", hp->h_no)); @@ -563,9 +563,9 @@ hpfs_setattr(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); if (cred->cr_uid != hp->h_uid && - (error = suser_xxx(cred, p, PRISON_ROOT)) && + (error = suser_xxx(cred, td->td_proc, PRISON_ROOT)) && ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, cred, p)))) + (error = VOP_ACCESS(vp, VWRITE, cred, td)))) return (error); if (vap->va_atime.tv_sec != VNOVAL) hp->h_atime = vap->va_atime.tv_sec; @@ -590,7 +590,7 @@ hpfs_setattr(ap) if (vap->va_size < hp->h_fn.fn_size) { #if defined(__FreeBSD__) - error = vtruncbuf(vp, cred, p, vap->va_size, DEV_BSIZE); + error = vtruncbuf(vp, cred, td, vap->va_size, DEV_BSIZE); if (error) return (error); #else /* defined(__NetBSD__) */ @@ -646,16 +646,16 @@ hpfs_inactive(ap) vprint("hpfs_inactive: pushing active", vp); if (hp->h_flag & H_INVAL) { - VOP__UNLOCK(vp,0,ap->a_p); + VOP__UNLOCK(vp,0,ap->a_td); #if defined(__FreeBSD__) - vrecycle(vp, NULL, ap->a_p); + vrecycle(vp, NULL, ap->a_td); #else /* defined(__NetBSD__) */ vgone(vp); #endif return (0); } - VOP__UNLOCK(vp,0,ap->a_p); + VOP__UNLOCK(vp,0,ap->a_td); return (0); } @@ -759,7 +759,7 @@ hpfs_access(ap) struct vnode *a_vp; int a_mode; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -800,7 +800,7 @@ hpfs_open(ap) struct vnode *a_vp; int a_mode; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { #if HPFS_DEBUG @@ -829,7 +829,7 @@ hpfs_close(ap) struct vnode *a_vp; int a_fflag; struct ucred *a_cred; - struct proc *a_p; + struct thread *a_td; } */ *ap; { #if HPFS_DEBUG @@ -1131,7 +1131,7 @@ hpfs_lookup(ap) return (EOPNOTSUPP); } - error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_proc); + error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_thread); if(error) return (error); @@ -1148,17 +1148,17 @@ hpfs_lookup(ap) dprintf(("hpfs_lookup(0x%x,...): .. faked (0x%x)\n", dhp->h_no, dhp->h_fn.fn_parent)); - VOP__UNLOCK(dvp,0,cnp->cn_proc); + VOP__UNLOCK(dvp,0,cnp->cn_thread); error = VFS_VGET(hpmp->hpm_mp, dhp->h_fn.fn_parent, ap->a_vpp); if(error) { - VOP__LOCK(dvp, 0, cnp->cn_proc); + VOP__LOCK(dvp, 0, cnp->cn_thread); return(error); } if( lockparent && (flags & ISLASTCN) && - (error = VOP__LOCK(dvp, 0, cnp->cn_proc)) ) { + (error = VOP__LOCK(dvp, 0, cnp->cn_thread)) ) { vput( *(ap->a_vpp) ); return (error); } @@ -1174,7 +1174,7 @@ hpfs_lookup(ap) if ((error == ENOENT) && (flags & ISLASTCN) && (nameiop == CREATE || nameiop == RENAME)) { if(!lockparent) - VOP__UNLOCK(dvp, 0, cnp->cn_proc); + VOP__UNLOCK(dvp, 0, cnp->cn_thread); cnp->cn_flags |= SAVENAME; return (EJUSTRETURN); } @@ -1186,7 +1186,7 @@ hpfs_lookup(ap) dep->de_fnode, dep->de_cpid)); if (nameiop == DELETE && (flags & ISLASTCN)) { - error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_proc); + error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_thread); if (error) { brelse(bp); return (error); @@ -1220,7 +1220,7 @@ hpfs_lookup(ap) brelse(bp); if(!lockparent || !(flags & ISLASTCN)) - VOP__UNLOCK(dvp, 0, cnp->cn_proc); + VOP__UNLOCK(dvp, 0, cnp->cn_thread); if ((flags & MAKEENTRY) && (!(flags & ISLASTCN) || (nameiop != DELETE && nameiop != CREATE))) |