From b8b3ac8816b79f4b10e71029cabb891ae0c33e03 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 27 Feb 2002 19:18:10 +0000 Subject: Use thread0.td_ucred instead of proc0.p_ucred. This change is cosmetic and isn't strictly required. However, it lowers the number of false positives found when grep'ing the kernel sources for p_ucred to ensure proper locking. --- sys/vm/swap_pager.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/vm/swap_pager.c') diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 57f2c9c..0504fed 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1135,8 +1135,8 @@ swap_pager_getpages(object, m, count, reqpage) bp->b_iocmd = BIO_READ; bp->b_iodone = swp_pager_async_iodone; - bp->b_rcred = crhold(proc0.p_ucred); - bp->b_wcred = crhold(proc0.p_ucred); + bp->b_rcred = crhold(thread0.td_ucred); + bp->b_wcred = crhold(thread0.td_ucred); bp->b_data = (caddr_t) kva; bp->b_blkno = blk - (reqpage - i); bp->b_bcount = PAGE_SIZE * (j - i); @@ -1386,8 +1386,8 @@ swap_pager_putpages(object, m, count, sync, rtvals) pmap_qenter((vm_offset_t)bp->b_data, &m[i], n); - bp->b_rcred = crhold(proc0.p_ucred); - bp->b_wcred = crhold(proc0.p_ucred); + bp->b_rcred = crhold(thread0.td_ucred); + bp->b_wcred = crhold(thread0.td_ucred); bp->b_bcount = PAGE_SIZE * n; bp->b_bufsize = PAGE_SIZE * n; bp->b_blkno = blk; @@ -2080,8 +2080,8 @@ getchainbuf(struct bio *bp, struct vnode *vp, int flags) nbp->b_iocmd = bp->bio_cmd; nbp->b_ioflags = 0; nbp->b_flags = flags; - nbp->b_rcred = crhold(proc0.p_ucred); - nbp->b_wcred = crhold(proc0.p_ucred); + nbp->b_rcred = crhold(thread0.td_ucred); + nbp->b_wcred = crhold(thread0.td_ucred); nbp->b_iodone = vm_pager_chain_iodone; if (vp) -- cgit v1.1