1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-16 15:11:52 +00:00

Remove the buffercache/vnode side of BIO_DELETE processing in

preparation for integration of p4::phk_bufwork.  In the future,
local filesystems will talk to GEOM directly and they will consequently
be able to issue BIO_DELETE directly.  Since the removal of the fla
driver, BIO_DELETE has effectively been a no-op anyway.
This commit is contained in:
Poul-Henning Kamp 2004-09-13 06:50:42 +00:00
parent cb5e18f34e
commit 883d3c0c07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135135
4 changed files with 3 additions and 56 deletions

View File

@ -54,7 +54,6 @@
static int spec_advlock(struct vop_advlock_args *);
static int spec_close(struct vop_close_args *);
static int spec_freeblks(struct vop_freeblks_args *);
static int spec_fsync(struct vop_fsync_args *);
static int spec_getpages(struct vop_getpages_args *);
static int spec_ioctl(struct vop_ioctl_args *);
@ -74,7 +73,6 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
{ &vop_bmap_desc, (vop_t *) vop_panic },
{ &vop_close_desc, (vop_t *) spec_close },
{ &vop_create_desc, (vop_t *) vop_panic },
{ &vop_freeblks_desc, (vop_t *) spec_freeblks },
{ &vop_fsync_desc, (vop_t *) spec_fsync },
{ &vop_getpages_desc, (vop_t *) spec_getpages },
{ &vop_getwritemount_desc, (vop_t *) vop_stdgetwritemount },
@ -462,10 +460,8 @@ spec_xstrategy(struct vnode *vp, struct buf *bp)
struct cdevsw *dsw;
struct thread *td = curthread;
KASSERT(bp->b_iocmd == BIO_READ ||
bp->b_iocmd == BIO_WRITE ||
bp->b_iocmd == BIO_DELETE,
("Wrong b_iocmd buf=%p cmd=%d", bp, bp->b_iocmd));
KASSERT(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE,
("Wrong b_iocmd buf=%p cmd=%d", bp, bp->b_iocmd));
/*
* Slow down disk requests for niced processes.
@ -529,33 +525,6 @@ spec_specstrategy(ap)
return spec_xstrategy(ap->a_vp, ap->a_bp);
}
static int
spec_freeblks(ap)
struct vop_freeblks_args /* {
struct vnode *a_vp;
daddr_t a_addr;
daddr_t a_length;
} */ *ap;
{
struct buf *bp;
/*
* XXX: This assumes that strategy does the deed right away.
* XXX: this may not be TRTTD.
*/
if ((ap->a_vp->v_rdev->si_flags & SI_CANDELETE) == 0)
return (0);
bp = geteblk(ap->a_length);
bp->b_iocmd = BIO_DELETE;
bp->b_dev = ap->a_vp->v_rdev;
bp->b_blkno = ap->a_addr;
bp->b_offset = dbtob(ap->a_addr);
bp->b_iooffset = bp->b_offset;
bp->b_bcount = ap->a_length;
BUF_KERNPROC(bp);
DEV_STRATEGY(bp);
return (0);
}
/*
* Device close routine

View File

@ -1234,8 +1234,7 @@ brelse(struct buf * bp)
bp->b_ioflags &= ~BIO_ERROR;
bdirty(bp);
} else if ((bp->b_flags & (B_NOCACHE | B_INVAL)) ||
(bp->b_ioflags & BIO_ERROR) ||
bp->b_iocmd == BIO_DELETE || (bp->b_bufsize <= 0)) {
(bp->b_ioflags & BIO_ERROR) || (bp->b_bufsize <= 0)) {
/*
* Either a failed I/O or we were asked to free or not
* cache the buffer.
@ -3130,12 +3129,6 @@ bufdone(struct buf *bp)
bp->b_flags |= B_DONE;
runningbufwakeup(bp);
if (bp->b_iocmd == BIO_DELETE) {
brelse(bp);
splx(s);
return;
}
if (bp->b_iocmd == BIO_WRITE) {
vwakeup(bp);
}

View File

@ -477,20 +477,6 @@ vop_putpages {
IN vm_ooffset_t offset;
};
#
#% freeblks vp - - -
#
# This call is used by the filesystem to release blocks back to
# device-driver. This is useful if the driver has a lengthy
# erase handling or similar.
#
vop_freeblks {
IN struct vnode *vp;
IN daddr_t addr;
IN daddr_t length;
};
#
#% getacl vp L L L
#

View File

@ -1705,7 +1705,6 @@ ffs_blkfree(fs, devvp, bno, size, inum)
if ((devvp->v_vflag & VV_COPYONWRITE) &&
ffs_snapblkfree(fs, devvp, bno, size, inum))
return;
VOP_FREEBLKS(devvp, fsbtodb(fs, bno), size);
}
#ifdef DIAGNOSTIC
if (dev->si_mountpoint &&