projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_4 release
[unix-history]
/
usr
/
src
/
sys
/
kern
/
vfs_bio.c
diff --git
a/usr/src/sys/kern/vfs_bio.c
b/usr/src/sys/kern/vfs_bio.c
index
379908e
..
be56e01
100644
(file)
--- a/
usr/src/sys/kern/vfs_bio.c
+++ b/
usr/src/sys/kern/vfs_bio.c
@@
-1,12
+1,12
@@
/*-
/*-
- * Copyright (c) 1982, 1986, 1989
The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1986, 1989
, 1993
+ *
The Regents of the University of California.
All rights reserved.
*
* This module is believed to contain source code proprietary to AT&T.
* Use and redistribution is subject to the Berkeley Software License
* Agreement and your Software Agreement with AT&T (Western Electric).
*
*
* This module is believed to contain source code proprietary to AT&T.
* Use and redistribution is subject to the Berkeley Software License
* Agreement and your Software Agreement with AT&T (Western Electric).
*
- * @(#)vfs_bio.c
7.60 (Berkeley) %G%
+ * @(#)vfs_bio.c
8.1 (Berkeley) 6/10/93
*/
#include <sys/param.h>
*/
#include <sys/param.h>
@@
-18,8
+18,6
@@
#include <sys/malloc.h>
#include <sys/resourcevar.h>
#include <libkern/libkern.h>
#include <sys/malloc.h>
#include <sys/resourcevar.h>
#include <libkern/libkern.h>
-#include <ufs/ufs/quota.h>
-#include <ufs/ufs/inode.h>
/*
* Definitions for the buffer hash lists.
/*
* Definitions for the buffer hash lists.
@@
-122,20
+120,13
@@
bread(vp, blkno, size, cred, bpp)
int size;
struct ucred *cred;
struct buf **bpp;
int size;
struct ucred *cred;
struct buf **bpp;
-#ifdef SECSIZE
- long secsize;
-#endif SECSIZE
{
struct proc *p = curproc; /* XXX */
register struct buf *bp;
if (size == 0)
panic("bread: size 0");
{
struct proc *p = curproc; /* XXX */
register struct buf *bp;
if (size == 0)
panic("bread: size 0");
-#ifdef SECSIZE
- bp = getblk(dev, blkno, size, secsize);
-#else SECSIZE
*bpp = bp = getblk(vp, blkno, size, 0, 0);
*bpp = bp = getblk(vp, blkno, size, 0, 0);
-#endif SECSIZE
if (bp->b_flags & (B_DONE | B_DELWRI)) {
trace(TR_BREADHIT, pack(vp, size), blkno);
return (0);
if (bp->b_flags & (B_DONE | B_DELWRI)) {
trace(TR_BREADHIT, pack(vp, size), blkno);
return (0);
@@
-160,9
+151,6
@@
bread(vp, blkno, size, cred, bpp)
breadn(vp, blkno, size, rablkno, rabsize, num, cred, bpp)
struct vnode *vp;
daddr_t blkno; int size;
breadn(vp, blkno, size, rablkno, rabsize, num, cred, bpp)
struct vnode *vp;
daddr_t blkno; int size;
-#ifdef SECSIZE
- long secsize;
-#endif SECSIZE
daddr_t rablkno[]; int rabsize[];
int num;
struct ucred *cred;
daddr_t rablkno[]; int rabsize[];
int num;
struct ucred *cred;
@@
-179,7
+167,6
@@
breadn(vp, blkno, size, rablkno, rabsize, num, cred, bpp)
*/
if (!incore(vp, blkno)) {
*bpp = bp = getblk(vp, blkno, size, 0, 0);
*/
if (!incore(vp, blkno)) {
*bpp = bp = getblk(vp, blkno, size, 0, 0);
-#endif SECSIZE
if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0) {
bp->b_flags |= B_READ;
if (bp->b_bcount > bp->b_bufsize)
if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0) {
bp->b_flags |= B_READ;
if (bp->b_bcount > bp->b_bufsize)
@@
-204,7
+191,6
@@
breadn(vp, blkno, size, rablkno, rabsize, num, cred, bpp)
if (incore(vp, rablkno[i]))
continue;
rabp = getblk(vp, rablkno[i], rabsize[i], 0, 0);
if (incore(vp, rablkno[i]))
continue;
rabp = getblk(vp, rablkno[i], rabsize[i], 0, 0);
-#endif SECSIZE
if (rabp->b_flags & (B_DONE | B_DELWRI)) {
brelse(rabp);
trace(TR_BREADHITRA, pack(vp, rabsize[i]), rablkno[i]);
if (rabp->b_flags & (B_DONE | B_DELWRI)) {
brelse(rabp);
trace(TR_BREADHITRA, pack(vp, rabsize[i]), rablkno[i]);
@@
-228,9
+214,6
@@
breadn(vp, blkno, size, rablkno, rabsize, num, cred, bpp)
* started above, so just wait for the read to complete.
*/
if (bp == NULL)
* started above, so just wait for the read to complete.
*/
if (bp == NULL)
-#ifdef SECSIZE
- return (bread(dev, blkno, size, secsize));
-#else SECSIZE
return (bread(vp, blkno, size, cred, bpp));
return (biowait(bp));
}
return (bread(vp, blkno, size, cred, bpp));
return (biowait(bp));
}
@@
-319,7
+302,7
@@
bdwrite(bp)
/*
* If this is a tape drive, the write must be initiated.
*/
/*
* If this is a tape drive, the write must be initiated.
*/
- if (
bdevsw[major(bp->b_dev)].d_flags & B_TAPE)
+ if (
VOP_IOCTL(bp->b_vp, 0, (caddr_t)B_TAPE, 0, NOCRED, p) == 0) {
bawrite(bp);
} else {
bp->b_flags |= (B_DONE | B_DELWRI);
bawrite(bp);
} else {
bp->b_flags |= (B_DONE | B_DELWRI);
@@
-428,16
+411,10
@@
incore(vp, blkno)
* allocate a new buffer and assign it to the block.
*/
struct buf *
* allocate a new buffer and assign it to the block.
*/
struct buf *
-#ifdef SECSIZE
-getblk(dev, blkno, size, secsize)
-#else SECSIZE
getblk(vp, blkno, size, slpflag, slptimeo)
register struct vnode *vp;
daddr_t blkno;
int size, slpflag, slptimeo;
getblk(vp, blkno, size, slpflag, slptimeo)
register struct vnode *vp;
daddr_t blkno;
int size, slpflag, slptimeo;
-#ifdef SECSIZE
- long secsize;
-#endif SECSIZE
{
register struct buf *bp;
struct list_entry *dp;
{
register struct buf *bp;
struct list_entry *dp;
@@
-502,9
+479,6
@@
loop:
bgetvp(vp, bp);
bp->b_bcount = 0;
bp->b_lblkno = blkno;
bgetvp(vp, bp);
bp->b_bcount = 0;
bp->b_lblkno = blkno;
-#ifdef SECSIZE
- bp->b_blksize = secsize;
-#endif SECSIZE
bp->b_blkno = blkno;
bp->b_error = 0;
bp->b_resid = 0;
bp->b_blkno = blkno;
bp->b_error = 0;
bp->b_resid = 0;
@@
-531,9
+505,6
@@
geteblk(size)
bremhash(bp);
binshash(bp, &invalhash);
bp->b_bcount = 0;
bremhash(bp);
binshash(bp, &invalhash);
bp->b_bcount = 0;
-#ifdef SECSIZE
- bp->b_blksize = DEV_BSIZE;
-#endif SECSIZE
bp->b_error = 0;
bp->b_resid = 0;
allocbuf(bp, size);
bp->b_error = 0;
bp->b_resid = 0;
allocbuf(bp, size);
@@
-624,40
+595,20
@@
getnewbuf(slpflag, slptimeo)
register struct queue_entry *dp;
register struct ucred *cred;
int s;
register struct queue_entry *dp;
register struct ucred *cred;
int s;
- struct buf *abp;
- static int losecnt = 0;
loop:
s = splbio();
loop:
s = splbio();
- abp = NULL;
- for (dp = &bufqueues[BQ_AGE]; dp > bufqueues; dp--) {
- for (bp = dp->qe_next; bp; bp = bp->b_freelist.qe_next) {
- if (abp == NULL)
- abp = bp;
- if ((bp->b_flags & B_DELWRI) &&
- bp->b_vp && VOP_ISLOCKED(bp->b_vp))
- continue;
- goto found;
- }
- }
+ for (dp = &bufqueues[BQ_AGE]; dp > bufqueues; dp--)
+ if (dp->qe_next)
+ break;
if (dp == bufqueues) { /* no free blocks */
if (dp == bufqueues) { /* no free blocks */
- if (abp) {
- bp = abp;
- bp->b_flags |= B_XXX;
- if (losecnt++ < 20) {
- vprint("skipping blkno check", bp->b_vp);
- printf("\tlblkno %d, blkno %d\n",
- bp->b_lblkno, bp->b_blkno);
- }
- goto found;
- }
needbuffer = 1;
(void) tsleep((caddr_t)&needbuffer, slpflag | (PRIBIO + 1),
"getnewbuf", slptimeo);
splx(s);
return (NULL);
}
needbuffer = 1;
(void) tsleep((caddr_t)&needbuffer, slpflag | (PRIBIO + 1),
"getnewbuf", slptimeo);
splx(s);
return (NULL);
}
-found:
+ bp = dp->qe_next;
bremfree(bp);
bp->b_flags |= B_BUSY;
splx(s);
bremfree(bp);
bp->b_flags |= B_BUSY;
splx(s);