DragonFly BSD

CVS log for src/sys/kern/kern_physio.c

[BACK] Up to [DragonFly] / src / sys / kern

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.25.4.1: download - view: text, markup, annotated - select for diffs
Thu Sep 25 01:44:52 2008 UTC (5 years, 7 months ago) by dillon
Branches: DragonFly_RELEASE_2_0
CVS tags: DragonFly_RELEASE_2_0_Slip
Diff to: previous 1.25: preferred, unified; next MAIN 1.26: preferred, unified
Changes since revision 1.25: +60 -25 lines
MFC numerous features from HEAD.

* Bounce buffer fixes for physio.
* Disk flush support in scsi and nata subsystems.
* Dead bio handling

Revision 1.27: download - view: text, markup, annotated - select for diffs
Fri Aug 22 08:47:56 2008 UTC (5 years, 8 months ago) by swildner
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +0 -7 lines
Remove unused variable.

Found-by: LLVM/Clang Static Analyzer

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Aug 10 20:03:14 2008 UTC (5 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +60 -18 lines
Implement a bounce buffer for physio if the buffer passed from userland
is not at least 16-byte aligned.

Reported-by: "Steve O'Hara-Smith" <steve@sohara.org>, and others

Revision 1.25: download - view: text, markup, annotated - select for diffs
Tue Aug 21 17:26:45 2007 UTC (6 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12, DragonFly_Preview
Branch point for: DragonFly_RELEASE_2_0
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +3 -0 lines
getpages/putpages fixup part 1 - Add support for UIO_NOCOPY VOP_WRITEs to
filesystems which use the buffer cache and assert that UIO_NOCOPY is not
being used for filesystems which do not.

For filesystems using the buffer cache all we have to do is force a
read-before-write to fill in any missing pieces of the buffer.

UIO_NOCOPY writes are used for buffer-cache-backed filesystems which do
not implement their own vop_putpages code.  At the moment this is only
the msdosfs.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Dec 23 00:35:04 2006 UTC (7 years, 4 months ago) by swildner
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8, DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +1 -1 lines
Rename printf -> kprintf in sys/ and add some defines where necessary
(files which are used in userland, too).

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun Sep 10 01:26:39 2006 UTC (7 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +1 -1 lines
Change the kernel dev_t, representing a pointer to a specinfo structure,
to cdev_t.  Change struct specinfo to struct cdev.  The name 'cdev' was taken
from FreeBSD.  Remove the dev_t shim for the kernel.

This commit generally removes the overloading of 'dev_t' between userland and
the kernel.

Also fix a bug in libkvm where a kernel dev_t (now cdev_t) was not being
properly converted to a userland dev_t.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Jul 28 02:17:40 2006 UTC (7 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +14 -1 lines
MASSIVE reorganization of the device operations vector.  Change cdevsw
to dev_ops.  dev_ops is a syslink-compatible operations vector structure
similar to the vop_ops structure used by vnodes.

Remove a huge number of instances where a thread pointer is still being
passed as an argument to various device ops and other related routines.
The device OPEN and IOCTL calls now take a ucred instead of a thread pointer,
and the CLOSE call no longer takes a thread pointer.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed May 3 20:44:49 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +0 -1 lines
- Clarify the definitions of b_bufsize, b_bcount, and b_resid.
- Remove unnecessary assignments based on the clarified fields.
- Add additional checks for premature EOF.

b_bufsize is only used by buffer management entities such as getblk() and
other vnode-backed buffer handling procedures.  b_bufsize is not required
for calls to vn_strategy() or dev_dstrategy().  A number of other subsystems
use it to track the original request size.

b_bcount is the I/O request size, but b_bcount() is allowed to be truncated
by the device chain if the request encompasses EOF (such as on a raw disk
device).  A caller which needs to record the original buffer size verses
the EOF-truncated buffer can compare b_bcount after the I/O against a
recorded copy of the original request size.  This copy can be recorded in
b_bufsize for unmanaged buffers (malloced or getpbuf()'d buffers).

b_resid is always relative to b_bcount, not b_bufsize.  A successful read
that is truncated to the device EOF will thus have a b_resid of 0 and a
truncated b_bcount.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue May 2 19:21:50 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +2 -1 lines
The wrong pointer was being used to calculate the page offset, leading
to a vmapbuf() assertion.  This bug was introduced in a recent commit.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Apr 30 20:23:23 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +13 -15 lines
Remove buf->b_saveaddr, assert that vmapbuf() is only called on pbuf's.  Pass
the user pointer and length to vmapbuf() rather then having it try to pull
the information out of the buffer.  vmapbuf() is now responsible for setting
b_data, b_bufsize, and b_bcount.

Also fix a bug in cam_periph_mapmem().  The procedure was failing to unmap
earlier vmapped bufs if later vmapbuf() calls in the loop failed.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Apr 30 17:22:17 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +5 -3 lines
Replace the the buffer cache's B_READ, B_WRITE, B_FORMAT, and B_FREEBUF
b_flags with a separate b_cmd field.  Use b_cmd to test for I/O completion
as well (getting rid of B_DONE in the process).  This further simplifies
the setup required to issue a buffer cache I/O.

Remove a redundant header file, bus/isa/i386/isa_dma.h and merge any
discrepancies into bus/isa/isavar.h.

Give ISADMA_READ/WRITE/RAW their own independant flag definitions instead of
trying to overload them on top of B_READ, B_WRITE, and B_RAW.  Add a
routine isa_dmabp() which takes a struct buf pointer and returns the ISA
dma flags associated with the operation.

Remove the 'clear_modify' argument to vfs_busy_pages().  Instead,
vfs_busy_pages() asserts that the buffer's b_cmd is valid and then uses
it to determine the action it must take.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Apr 28 16:34:01 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +4 -2 lines
Get rid of pbgetvp() and pbrelvp().  Instead fold the B_PAGING flag directly
into getpbuf() (the only type of buffer that pbgetvp() could be called on
anyway).  Change related b_flags assignments from '=' to '|='.

Get rid of remaining depdendancies on b_vp.  vn_strategy() now relies solely
on the vp passed to it as an argument.  Remove buffer cache code that sets
b_vp for anonymous pbuf's.

Add a stopgap 'vp' argument to vfs_busy_pages().  This is only really needed
by NFS and the clustering code do to the severely hackish nature of the
NFS and clustering code.

Fix a bug in the ext2fs inode code where vfs_busy_pages() was being called
on B_CACHE buffers.  Add an assertion to vfs_busy_pages() to panic if it
encounters a B_CACHE buffer.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Fri Apr 28 00:24:46 2006 UTC (7 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +2 -2 lines
Remove the buffer cache's B_PHYS flag.  This flag was originally used as
part of a severe hack to treat buffers containing 'user' addresses
differently, in particular by using b_offset instead of b_blkno.  Now that
buffer cache buffers only HAVE b_offset (b_*blkno is gone for good), there
is literally no difference between B_PHYS I/O and non-B_PHYS I/O once
the buffer has been handed off to the device.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Mar 24 18:35:33 2006 UTC (8 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +0 -12 lines
Major BUF/BIO work commit.  Make I/O BIO-centric and specify the disk or
file location with a 64 bit offset instead of a 32 bit block number.

* All I/O is now BIO-centric instead of BUF-centric.

* File/Disk addresses universally use a 64 bit bio_offset now.  bio_blkno
  no longer exists.

* Stackable BIO's hold disk offset translations.  Translations are no longer
  overloaded onto a single structure (BUF or BIO).

* bio_offset == NOOFFSET is now universally used to indicate that a
  translation has not been made.  The old (blkno == lblkno) junk has all
  been removed.

* There is no longer a distinction between logical I/O and physical I/O.

* All driver BUFQs have been converted to BIOQs.

* BMAP, FREEBLKS, getblk, bread, breadn, bwrite, inmem, cluster_*,
  and findblk all now take and/or return 64 bit byte offsets instead
  of block numbers.  Note that BMAP now returns a byte range for the before
  and after variables.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Fri Feb 17 19:18:06 2006 UTC (8 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +16 -11 lines
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

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Nov 19 17:58:21 2005 UTC (8 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +0 -6 lines
Protect allproc scans with PHOLD/PRELE, in particular to support the
sysctl that fstat uses.

Add an additional wait state in exit1() when p_lock is non-zero.  Do not
remove the process from the allproc list until p_lock is zero in order to
protect allproc scans.

Remove a spurious PHOLD in the NFS code.  Generally clean up uses of PHOLD
that no longer apply.

Fstat problems reported by: Stefan Krueger <skrueger@meinberlikomm.de>

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Aug 4 21:08:35 2005 UTC (8 years, 8 months ago) by hmp
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +1 -5 lines
BUF/BIO cleanup 4/99:

Garbage-collect physio_proc_{enter,leave,init} because these functions
only existed for PC-98 compatibility reasons.  This commit is a NOP
and shouldn't make any operational difference.

The purpose of those functions was totally redundant, it just kept a
copy of buf->b_proc and other fields in a separately maintained TAILQ
list called physio_proc_head and physio_proc_feet corresponding to
physio_proc_enter/leave respectively.

The stub definitions and the machine/physio_proc.h header file will
disappear after the drivers using these functions are cleaned up.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Aug 3 16:36:33 2005 UTC (8 years, 8 months ago) by hmp
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +2 -2 lines
BUF/BIO cleanup 3/99:

Retire the B_CALL flag in favour of checking the bp->b_iodone pointer
directly, thus simplifying the BUF interface even more.

Move scattered B_UNUSED* flag space defintions into one place, that
is below the rest of the definitions.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Jun 6 15:02:28 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +2 -3 lines
Remove spl*() calls from kern, replacing them with critical sections.
Change the meaning of safepri from a cpl mask to a thread priority.
Make a minor adjustment to tests within one of the buffer cache's
critical sections.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Fri Dec 31 22:30:19 2004 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +1 -0 lines
Restore b_data prior to calling relpbuf().  This isn't really necessary but
it's a good cleanup to do in case the pbuf API changes later on.

Submitted-by: Found in Chris Pressey's tree, source is a mystery!

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Feb 16 20:11:20 2004 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004, DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +5 -0 lines
Remove common declaration for -fno-common

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Feb 10 00:50:03 2004 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +1 -1 lines
devsw() does not exist in DFly.  use dev_dflags() to extract d_flags.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Feb 9 21:51:28 2004 UTC (10 years, 2 months ago) by hmp
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +9 -2 lines
Merge from FreeBSD:

	Don't check block number overflow for D_MEM;
	/dev/fwmem needs 48-bit offsets.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Jul 22 17:03:33 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +1 -0 lines
DEV messaging stage 2/4: In this stage all DEV commands are now being
funneled through the message port for action by the port's beginmsg function.
CONSOLE and DISK device shims replace the port with their own and then
forward to the original.  FB (Frame Buffer) shims supposedly do the same
thing but I haven't been able to test it.   I don't expect instability
in mainline code but there might be easy-to-fix, and some drivers still need
to be converted.  See primarily: kern/kern_device.c (new dev_*() functions and
inherits cdevsw code from kern/kern_conf.c), sys/device.h, and kern/subr_disk.c
for the high points.

In this stage all DEV messages are still acted upon synchronously in the
context of the caller.  We cannot create a separate handler thread until
the copyin's (primarily in ioctl functions) are made thread-aware.

Note that the messaging shims are going to look rather messy in these early
days but as more subsystems are converted over we will begin to use
pre-initialized messages and message forwarding to avoid having to constantly
rebuild messages prior to use.

Note that DEV itself is a mess oweing to its 4.x roots and will be cleaned
up in subsequent passes.  e.g. the way sub-devices inherit the main device's
cdevsw was always a bad hack and it still is, and several functions
(mmap, kqfilter, psize, poll) return results rather then error codes, which
will be fixed since now we have a message to store the result in :-)

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Jul 19 21:14:38 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +2 -2 lines
Remove the priority part of the priority|flags argument to tsleep().  Only
flags are passed now.  The priority was a user scheduler thingy that is not
used by the LWKT subsystem.  For process statistics assume sleeps without
P_SINTR set to be disk-waits, and sleeps with it set to be normal sleeps.

This commit should not contain any operational changes.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Jun 26 20:27:51 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +7 -5 lines
cleanup some odd uses of curproc.  Remove PHOLD/PRELE around physical I/O
(our UPAGES can no longer be swapped out and if they eventually are made
to it will only be when the thread is sleeping on a particular address).

Also move the inblock/oublock accounting in vfs_busy_pages() allowing us
to remove additional curproc references from various filesystem code.  This
also makes inblock/oublock more consistent.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:41 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +1 -0 lines
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids.  Most
ids have been removed from !lint sections and moved into comment sections.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:55:01 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.46.2.3

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options