Remove buf->b_dev field.
This commit is contained in:
parent
c7aaa71ce3
commit
c569065139
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137186
@ -61,7 +61,6 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
bp->b_iocmd = BIO_READ;
|
||||
else
|
||||
bp->b_iocmd = BIO_WRITE;
|
||||
bp->b_dev = dev;
|
||||
bp->b_iodone = bdone;
|
||||
bp->b_data = uio->uio_iov[i].iov_base;
|
||||
bp->b_bcount = uio->uio_iov[i].iov_len;
|
||||
|
@ -339,16 +339,19 @@ boot(int howto)
|
||||
for (bp = &buf[nbuf]; --bp >= buf; ) {
|
||||
if (((bp->b_flags&B_INVAL) == 0 && BUF_REFCNT(bp)) ||
|
||||
((bp->b_flags & (B_DELWRI|B_INVAL)) == B_DELWRI)) {
|
||||
#if 0
|
||||
/* XXX: This is bogus. We should probably have a BO_REMOTE flag instead */
|
||||
if (bp->b_dev == NULL) {
|
||||
TAILQ_REMOVE(&mountlist,
|
||||
bp->b_vp->v_mount, mnt_list);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
nbusy++;
|
||||
#if defined(SHOW_BUSYBUFS) || defined(DIAGNOSTIC)
|
||||
printf(
|
||||
"%d: dev:%s, flags:%0x, blkno:%ld, lblkno:%ld\n",
|
||||
nbusy, devtoname(bp->b_dev),
|
||||
"%d: bufobj:%p, flags:%0x, blkno:%ld, lblkno:%ld\n",
|
||||
nbusy, bp->b_bufobj,
|
||||
bp->b_flags, (long)bp->b_blkno,
|
||||
(long)bp->b_lblkno);
|
||||
#endif
|
||||
|
@ -1110,7 +1110,6 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
|
||||
/*
|
||||
* Get a copy of the kva from the physical buffer.
|
||||
*/
|
||||
bp->b_dev = vp->v_rdev;
|
||||
error = 0;
|
||||
|
||||
bp->b_bcount = cb->aio_nbytes;
|
||||
|
@ -540,7 +540,6 @@ bufinit(void)
|
||||
bp = &buf[i];
|
||||
bzero(bp, sizeof *bp);
|
||||
bp->b_flags = B_INVAL; /* we're just an empty header */
|
||||
bp->b_dev = NULL;
|
||||
bp->b_rcred = NOCRED;
|
||||
bp->b_wcred = NOCRED;
|
||||
bp->b_qindex = QUEUE_EMPTY;
|
||||
@ -1422,7 +1421,6 @@ brelse(struct buf *bp)
|
||||
bp->b_qindex = QUEUE_EMPTY;
|
||||
}
|
||||
TAILQ_INSERT_HEAD(&bufqueues[bp->b_qindex], bp, b_freelist);
|
||||
bp->b_dev = NULL;
|
||||
/* buffers with junk contents */
|
||||
} else if (bp->b_flags & (B_INVAL | B_NOCACHE | B_RELBUF) ||
|
||||
(bp->b_ioflags & BIO_ERROR)) {
|
||||
@ -1432,7 +1430,6 @@ brelse(struct buf *bp)
|
||||
panic("losing buffer 2");
|
||||
bp->b_qindex = QUEUE_CLEAN;
|
||||
TAILQ_INSERT_HEAD(&bufqueues[QUEUE_CLEAN], bp, b_freelist);
|
||||
bp->b_dev = NULL;
|
||||
/* remaining buffers */
|
||||
} else {
|
||||
if (bp->b_flags & B_DELWRI)
|
||||
@ -1925,7 +1922,6 @@ getnewbuf(int slpflag, int slptimeo, int size, int maxsize)
|
||||
bp->b_ioflags = 0;
|
||||
bp->b_xflags = 0;
|
||||
bp->b_vflags = 0;
|
||||
bp->b_dev = NULL;
|
||||
bp->b_vp = NULL;
|
||||
bp->b_blkno = bp->b_lblkno = 0;
|
||||
bp->b_offset = NOOFFSET;
|
||||
@ -3873,10 +3869,9 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
|
||||
db_printf("b_flags = 0x%b\n", (u_int)bp->b_flags, PRINT_BUF_FLAGS);
|
||||
db_printf(
|
||||
"b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n"
|
||||
"b_dev = (%d,%d), b_data = %p, b_blkno = %jd\n",
|
||||
"b_bufobj = (%p), b_data = %p, b_blkno = %jd\n",
|
||||
bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid,
|
||||
major(bp->b_dev), minor(bp->b_dev), bp->b_data,
|
||||
(intmax_t)bp->b_blkno);
|
||||
bp->b_bufobj, bp->b_data, (intmax_t)bp->b_blkno);
|
||||
if (bp->b_npages) {
|
||||
int i;
|
||||
db_printf("b_npages = %d, pages(OBJ, IDX, PA): ", bp->b_npages);
|
||||
|
@ -1378,7 +1378,6 @@ bgetvp(struct vnode *vp, struct buf *bp)
|
||||
vholdl(vp);
|
||||
bp->b_vp = vp;
|
||||
bp->b_bufobj = &vp->v_bufobj;
|
||||
bp->b_dev = vn_todev(vp);
|
||||
/*
|
||||
* Insert onto list for new vnode.
|
||||
*/
|
||||
@ -1699,7 +1698,6 @@ pbgetvp(vp, bp)
|
||||
|
||||
bp->b_vp = vp;
|
||||
bp->b_flags |= B_PAGING;
|
||||
bp->b_dev = vn_todev(vp);
|
||||
bp->b_bufobj = &vp->v_bufobj;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,6 @@ struct buf {
|
||||
#define b_bcount b_io.bio_bcount
|
||||
#define b_caller1 b_io.bio_caller1
|
||||
#define b_data b_io.bio_data
|
||||
#define b_dev b_io.bio_dev
|
||||
#define b_error b_io.bio_error
|
||||
#define b_iocmd b_io.bio_cmd
|
||||
#define b_ioflags b_io.bio_flags
|
||||
|
@ -1133,9 +1133,8 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
|
||||
cnt.v_intrans++;
|
||||
if (msleep(mreq, &vm_page_queue_mtx, PSWP, "swread", hz*20)) {
|
||||
printf(
|
||||
"swap_pager: indefinite wait buffer: device: %s, blkno: %jd, size: %ld\n",
|
||||
bp->b_dev == NULL ? "[NULL]" : devtoname(bp->b_dev),
|
||||
(intmax_t)bp->b_blkno, bp->b_bcount);
|
||||
"swap_pager: indefinite wait buffer: bufobj: %p, blkno: %jd, size: %ld\n",
|
||||
bp->b_bufobj, (intmax_t)bp->b_blkno, bp->b_bcount);
|
||||
}
|
||||
}
|
||||
vm_page_unlock_queues();
|
||||
@ -2537,7 +2536,6 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp)
|
||||
int s;
|
||||
struct vnode *vp2;
|
||||
|
||||
bp->b_dev = NULL;
|
||||
bp->b_blkno = ctodb(bp->b_blkno - sp->sw_first);
|
||||
|
||||
vp2 = sp->sw_id;
|
||||
|
Loading…
Reference in New Issue
Block a user