diff options
author | jhb <jhb@FreeBSD.org> | 2002-02-27 18:32:23 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-02-27 18:32:23 +0000 |
commit | 3706cd350927f08fa8742cce9448c9ba8e4d6b2c (patch) | |
tree | de74317436bc6bf8211535e1dbda3f6762d05582 /sys/vm | |
parent | ec01b5bdbc40025303ba133be03a747c8dc62a2c (diff) | |
download | FreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.zip FreeBSD-src-3706cd350927f08fa8742cce9448c9ba8e4d6b2c.tar.gz |
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_mmap.c | 6 | ||||
-rw-r--r-- | sys/vm/vm_swap.c | 11 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 12 |
3 files changed, 14 insertions, 15 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index aafa26a..27a1ae3 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -346,7 +346,7 @@ mmap(td, uap) * other securelevel. * XXX this will have to go */ - if (securelevel_ge(td->td_proc->p_ucred, 1)) + if (securelevel_ge(td->td_ucred, 1)) disablexworkaround = 1; else disablexworkaround = suser_td(td); @@ -387,7 +387,7 @@ mmap(td, uap) struct vattr va; if ((error = VOP_GETATTR(vp, &va, - td->td_proc->p_ucred, td))) { + td->td_ucred, td))) { goto done; } if ((va.va_flags & @@ -1184,7 +1184,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, struct vattr vat; int error; - error = VOP_GETATTR(vp, &vat, td->td_proc->p_ucred, td); + error = VOP_GETATTR(vp, &vat, td->td_ucred, td); if (error) { mtx_unlock(&Giant); return (error); diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 1a26712..eb7251c 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -222,7 +222,7 @@ swapon(td, uap) if (vn_isdisk(vp, &error)) error = swaponvp(td, vp, vp->v_rdev, 0); else if (vp->v_type == VREG && vp->v_tag == VT_NFS && - (error = VOP_GETATTR(vp, &attr, td->td_proc->p_ucred, td)) == 0) { + (error = VOP_GETATTR(vp, &attr, td->td_ucred, td)) == 0) { /* * Allow direct swapping to NFS regular files in the same * way that nfs_mountroot() sets up diskless swapping. @@ -262,7 +262,6 @@ swaponvp(td, vp, dev, nblks) swblk_t dvbase; int error; u_long aligned_nblks; - struct proc *p = td->td_proc; if (!swapdev_vp) { error = getnewvnode(VT_NON, NULL, swapdev_vnodeop_p, @@ -283,18 +282,18 @@ swaponvp(td, vp, dev, nblks) return EINVAL; found: (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - error = VOP_OPEN(vp, FREAD | FWRITE, p->p_ucred, td); + error = VOP_OPEN(vp, FREAD | FWRITE, td->td_ucred, td); (void) VOP_UNLOCK(vp, 0, td); if (error) return (error); if (nblks == 0 && dev != NODEV && (devsw(dev)->d_psize == 0 || (nblks = (*devsw(dev)->d_psize) (dev)) == -1)) { - (void) VOP_CLOSE(vp, FREAD | FWRITE, p->p_ucred, td); + (void) VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); return (ENXIO); } if (nblks == 0) { - (void) VOP_CLOSE(vp, FREAD | FWRITE, p->p_ucred, td); + (void) VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); return (ENXIO); } @@ -305,7 +304,7 @@ swaponvp(td, vp, dev, nblks) if (nblks > 0x40000000 / BLIST_META_RADIX / nswdev) { printf("exceeded maximum of %d blocks per swap unit\n", 0x40000000 / BLIST_META_RADIX / nswdev); - (void) VOP_CLOSE(vp, FREAD | FWRITE, p->p_ucred, td); + (void) VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); return (ENXIO); } /* diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index b0348c6..d9d1d73 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -463,8 +463,8 @@ vnode_pager_input_smlfs(object, m) bp->b_iodone = vnode_pager_iodone; KASSERT(bp->b_rcred == NOCRED, ("leaking read ucred")); KASSERT(bp->b_wcred == NOCRED, ("leaking write ucred")); - bp->b_rcred = crhold(curthread->td_proc->p_ucred); - bp->b_wcred = crhold(curthread->td_proc->p_ucred); + bp->b_rcred = crhold(curthread->td_ucred); + bp->b_wcred = crhold(curthread->td_ucred); bp->b_data = (caddr_t) kva + i * bsize; bp->b_blkno = fileaddr; pbgetvp(dp, bp); @@ -555,7 +555,7 @@ vnode_pager_input_old(object, m) auio.uio_resid = size; auio.uio_td = curthread; - error = VOP_READ(vp, &auio, 0, curthread->td_proc->p_ucred); + error = VOP_READ(vp, &auio, 0, curthread->td_ucred); if (!error) { int count = size - auio.uio_resid; @@ -782,8 +782,8 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) /* B_PHYS is not set, but it is nice to fill this in */ KASSERT(bp->b_rcred == NOCRED, ("leaking read ucred")); KASSERT(bp->b_wcred == NOCRED, ("leaking write ucred")); - bp->b_rcred = crhold(curthread->td_proc->p_ucred); - bp->b_wcred = crhold(curthread->td_proc->p_ucred); + bp->b_rcred = crhold(curthread->td_ucred); + bp->b_wcred = crhold(curthread->td_ucred); bp->b_blkno = firstaddr; pbgetvp(dp, bp); bp->b_bcount = size; @@ -1030,7 +1030,7 @@ vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals) auio.uio_rw = UIO_WRITE; auio.uio_resid = maxsize; auio.uio_td = (struct thread *) 0; - error = VOP_WRITE(vp, &auio, ioflags, curthread->td_proc->p_ucred); + error = VOP_WRITE(vp, &auio, ioflags, curthread->td_ucred); cnt.v_vnodeout++; cnt.v_vnodepgsout += ncount; |