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/vm_swap.c | |
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/vm_swap.c')
-rw-r--r-- | sys/vm/vm_swap.c | 11 |
1 files changed, 5 insertions, 6 deletions
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); } /* |