Make the entire BUF/BIO system BIO-centric instead of BUF-centric. Vnode
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 17 Feb 2006 19:18:08 +0000 (19:18 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 17 Feb 2006 19:18:08 +0000 (19:18 +0000)
commit81b5c339e872cfa95a68273b02d8eccb639741a9
tree5d174e009c7cc874609f4365a55215b9f660e867
parent4b4c8cf7efdee159e52dbbbb3d96521026508557
Make the entire BUF/BIO system BIO-centric instead of BUF-centric.  Vnode
and device strategy routines now take a BIO and must pass that BIO to
biodone().  All code which previously managed a BUF undergoing I/O now
manages a BIO.

The new BIO-centric algorithms allow BIOs to be stacked, where each layer
represents a block translation, completion callback, or caller or device
private data.  This information is no longer overloaded within the BUF.
Translation layer linkages remain intact as a 'cache' after I/O has completed.

The VOP and DEV strategy routines no longer make assumptions as to which
translated block number applies to them.  The use the block number in the
BIO specifically passed to them.

Change the 'untranslated' constant to NOOFFSET (for bio_offset), and
(daddr_t)-1 (for bio_blkno).  Rip out all code that previously set the
translated block number to the untranslated block number to indicate
that the translation had not been made.

Rip out all the cluster linkage fields for clustered VFS and clustered
paging operations.  Clustering now occurs in a private BIO layer using
private fields within the BIO.

Reformulate the vn_strategy() and dev_dstrategy() abstraction(s).  These
routines no longer assume that bp->b_vp == the vp of the VOP operation, and
the dev_t is no longer stored in the struct buf.  Instead, only the vp passed
to vn_strategy() (and related *_strategy() routines for VFS ops), and
the dev_t passed to dev_dstrateg() (and related *_strategy() routines for
device ops) is used by the VFS or DEV code.  This will allow an arbitrary
number of translation layers in the future.

Create an independant per-BIO tracking entity, struct bio_track, which
is used to determine when I/O is in-progress on the associated device
or vnode.

NOTE: Unlike FreeBSD's BIO work, our struct BUF is still used to hold
the fields describing the data buffer, resid, and error state.

Major-testing-by: Stefan Krueger
147 files changed:
sys/bus/cam/scsi/scsi_cd.c
sys/bus/cam/scsi/scsi_ch.c
sys/bus/cam/scsi/scsi_da.c
sys/bus/cam/scsi/scsi_pass.c
sys/bus/cam/scsi/scsi_pt.c
sys/bus/cam/scsi/scsi_sa.c
sys/bus/cam/scsi/scsi_ses.c
sys/bus/firewire/firewirereg.h
sys/bus/firewire/fwdev.c
sys/bus/firewire/fwmem.c
sys/contrib/dev/fla/fla.c
sys/dev/disk/ata/ata-disk.c
sys/dev/disk/ata/ata-disk.h
sys/dev/disk/ata/ata-raid.c
sys/dev/disk/ata/ata-raid.h
sys/dev/disk/ata/atapi-all.c
sys/dev/disk/ata/atapi-cd.c
sys/dev/disk/ata/atapi-cd.h
sys/dev/disk/ata/atapi-fd.c
sys/dev/disk/ata/atapi-fd.h
sys/dev/disk/ata/atapi-tape.c
sys/dev/disk/ata/atapi-tape.h
sys/dev/disk/ccd/ccd.c
sys/dev/disk/fd/fd.c
sys/dev/disk/fd/fdc.h
sys/dev/disk/mcd/mcd.c
sys/dev/disk/md/md.c
sys/dev/disk/scd/scd.c
sys/dev/disk/vn/vn.c
sys/dev/disk/wt/wt.c
sys/dev/misc/labpc/labpc.c
sys/dev/netif/de/if_de.c
sys/dev/netif/de/if_devar.h
sys/dev/raid/aac/aac.c
sys/dev/raid/aac/aac_compat.h
sys/dev/raid/aac/aac_disk.c
sys/dev/raid/aac/aacvar.h
sys/dev/raid/amr/amr.c
sys/dev/raid/amr/amr_compat.h
sys/dev/raid/amr/amr_disk.c
sys/dev/raid/amr/amrvar.h
sys/dev/raid/ida/ida.c
sys/dev/raid/ida/ida_disk.c
sys/dev/raid/ida/idavar.h
sys/dev/raid/ips/ips.h
sys/dev/raid/ips/ips_commands.c
sys/dev/raid/ips/ips_disk.c
sys/dev/raid/ips/ips_pci.c
sys/dev/raid/mlx/mlx.c
sys/dev/raid/mlx/mlx_compat.h
sys/dev/raid/mlx/mlx_disk.c
sys/dev/raid/mlx/mlxvar.h
sys/dev/raid/pst/pst-raid.c
sys/dev/raid/twe/twe.c
sys/dev/raid/twe/twe_compat.h
sys/dev/raid/twe/twe_freebsd.c
sys/dev/raid/twe/twevar.h
sys/dev/raid/vinum/.gdbinit.crash
sys/dev/raid/vinum/.gdbinit.kernel
sys/dev/raid/vinum/.gdbinit.vinum
sys/dev/raid/vinum/request.h
sys/dev/raid/vinum/vinumdaemon.c
sys/dev/raid/vinum/vinumext.h
sys/dev/raid/vinum/vinuminterrupt.c
sys/dev/raid/vinum/vinumio.c
sys/dev/raid/vinum/vinumlock.c
sys/dev/raid/vinum/vinumraid5.c
sys/dev/raid/vinum/vinumrequest.c
sys/dev/raid/vinum/vinumrevive.c
sys/dev/raid/vinum/vinumstate.c
sys/dev/raid/vinum/vinumvar.h
sys/i386/i386/machdep.c
sys/kern/kern_device.c
sys/kern/kern_physio.c
sys/kern/kern_shutdown.c
sys/kern/subr_disk.c
sys/kern/subr_diskmbr.c
sys/kern/subr_diskslice.c
sys/kern/subr_xxx.c
sys/kern/tty_cons.c
sys/kern/vfs_aio.c
sys/kern/vfs_bio.c
sys/kern/vfs_cluster.c
sys/kern/vfs_default.c
sys/kern/vfs_lock.c
sys/kern/vfs_subr.c
sys/kern/vfs_vopops.c
sys/platform/pc32/i386/machdep.c
sys/sys/bio.h
sys/sys/biotrack.h [new file with mode: 0644]
sys/sys/buf.h
sys/sys/buf2.h
sys/sys/conf.h
sys/sys/device.h
sys/sys/disklabel.h
sys/sys/disklabel32.h
sys/sys/diskslice.h
sys/sys/odisklabel.h
sys/sys/vfsops.h
sys/sys/vnode.h
sys/vfs/coda/coda_vnops.c
sys/vfs/coda/coda_vnops.h
sys/vfs/gnu/ext2fs/ext2_alloc.c
sys/vfs/gnu/ext2fs/ext2_balloc.c
sys/vfs/gnu/ext2fs/ext2_inode.c
sys/vfs/gnu/ext2fs/ext2_subr.c
sys/vfs/gnu/ext2fs/ext2_vnops.c
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/isofs/cd9660/cd9660_lookup.c
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/mfs/mfs_extern.h
sys/vfs/mfs/mfs_vfsops.c
sys/vfs/mfs/mfs_vnops.c
sys/vfs/mfs/mfsnode.h
sys/vfs/msdosfs/msdosfs_fat.c
sys/vfs/msdosfs/msdosfs_vfsops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs.h
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_syscalls.c
sys/vfs/nfs/nfs_vfsops.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsmount.h
sys/vfs/ntfs/ntfs_vnops.c
sys/vfs/nwfs/nwfs.h
sys/vfs/nwfs/nwfs_io.c
sys/vfs/nwfs/nwfs_vnops.c
sys/vfs/smbfs/smbfs.h
sys/vfs/smbfs/smbfs_io.c
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/specfs/spec_vnops.c
sys/vfs/udf/udf_vnops.c
sys/vfs/ufs/ffs_alloc.c
sys/vfs/ufs/ffs_balloc.c
sys/vfs/ufs/ffs_inode.c
sys/vfs/ufs/ffs_rawread.c
sys/vfs/ufs/ffs_softdep.c
sys/vfs/ufs/ffs_subr.c
sys/vfs/ufs/ffs_vfsops.c
sys/vfs/ufs/ufs_bmap.c
sys/vfs/ufs/ufs_vnops.c
sys/vfs/union/union_vnops.c
sys/vm/swap_pager.c
sys/vm/vm_pager.c
sys/vm/vm_pager.h
sys/vm/vm_swap.c
sys/vm/vnode_pager.c