diff options
author | jhb <jhb@FreeBSD.org> | 2001-10-11 23:38:17 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-10-11 23:38:17 +0000 |
commit | 4806d88677d2a333254f9fc33d4e119cc56bb002 (patch) | |
tree | d3ca87a8ac917d5003235cc737cd5f76591f7c1b /sys/kern/vfs_bio.c | |
parent | 9f68054d87b5538c76f0b802ef8f7344eedd5647 (diff) | |
download | FreeBSD-src-4806d88677d2a333254f9fc33d4e119cc56bb002.zip FreeBSD-src-4806d88677d2a333254f9fc33d4e119cc56bb002.tar.gz |
Change the kernel's ucred API as follows:
- crhold() returns a reference to the ucred whose refcount it bumps.
- crcopy() now simply copies the credentials from one credential to
another and has no return value.
- a new crshared() primitive is added which returns true if a ucred's
refcount is > 1 and false (0) otherwise.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index f2a78bd..510222c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -599,11 +599,8 @@ breadn(struct vnode * vp, daddr_t blkno, int size, bp->b_iocmd = BIO_READ; bp->b_flags &= ~B_INVAL; bp->b_ioflags &= ~BIO_ERROR; - if (bp->b_rcred == NOCRED) { - if (cred != NOCRED) - crhold(cred); - bp->b_rcred = cred; - } + if (bp->b_rcred == NOCRED && cred != NOCRED) + bp->b_rcred = crhold(cred); vfs_busy_pages(bp, 0); VOP_STRATEGY(vp, bp); ++readwait; @@ -621,11 +618,8 @@ breadn(struct vnode * vp, daddr_t blkno, int size, rabp->b_flags &= ~B_INVAL; rabp->b_ioflags &= ~BIO_ERROR; rabp->b_iocmd = BIO_READ; - if (rabp->b_rcred == NOCRED) { - if (cred != NOCRED) - crhold(cred); - rabp->b_rcred = cred; - } + if (rabp->b_rcred == NOCRED && cred != NOCRED) + rabp->b_rcred = crhold(cred); vfs_busy_pages(rabp, 0); BUF_KERNPROC(rabp); VOP_STRATEGY(vp, rabp); |