summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_physio.c
Commit message (Collapse)AuthorAgeFilesLines
* Account i/o done on cdevs.kib2010-11-251-2/+5
| | | | | Reported and tested by: Adam Vande More <amvandemore gmail com> MFC after: 1 week
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Remove buf->b_dev field.phk2004-11-041-1/+0
|
* Give dev_strategy() an explict cdev argument in preparation for removingphk2004-10-291-1/+1
| | | | | | | | | | | buf->b-dev. Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber fields in the buf. Assert copyright on vfs_bio.c and update copyright message to canonical text. There is no legal difference between John Dysons two-clause abbreviated BSD license and the canonical text.
* Eliminate DEV_STRATEGY() macro: call dev_strategy() directly.phk2004-09-231-1/+1
| | | | Make dev_strategy() handle errors and departing devices properly.
* Eliminate the acquisition and release of Giant within physio(). Removealc2004-08-101-6/+0
| | | | | | | the spl calls. Reviewed by: phk@ Discussed with: scottl@
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Send B_PHYS out to pasture, it no longer serves any function.phk2003-11-151-1/+1
|
* Initialize b_iooffset before calling strategyphk2003-10-181-0/+1
|
* Grab Giant in physio() since non-giant drivers are starting to appear.phk2003-08-021-0/+3
|
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Don't reinitialize fields that are already initialized by getpbuf().alc2003-04-051-1/+1
|
* Sufficient access checks are performed by vmapbuf() that callingalc2003-04-051-15/+1
| | | | | | useracc() is pointless. Remove the call to useracc() from physio(). Reviewed by: tegge
* - Add a lock for protecting against msleep(bp, ...) wakeup(bp) races.jeff2003-03-131-9/+5
| | | | | | | | | | - Create a new function bdone() which sets B_DONE and calls wakup(bp). This is suitable for use as b_iodone for buf consumers who are not going through the buf cache. - Create a new function bwait() which waits for the buf to be done at a set priority and with a specific wmesg. - Replace several cases where the above functionality was implemented without locking with the new functions.
* Close the remaining user address mapping races for physicaldillon2003-01-201-1/+11
| | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days
* Remove unused second argument from DEV_STRATEGY().phk2003-01-031-1/+1
|
* Change iov_base's type from `char *' to the standard `void *'. Allmike2002-10-111-1/+2
| | | | | uses of iov_base which assume its type is `char *' (in order to do pointer arithmetic) have been updated to cast iov_base to `char *'.
* More caddr_t removal, make fo_ioctl take a void * instead of a caddr_t.alfred2002-06-291-2/+2
|
* Use btodb() macro.phk2002-05-181-7/+1
| | | | Sponsored by: DARPA & NAI Labs.
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-021-2/+2
| | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde.
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-201-1/+1
| | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts.
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful.
* Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for thephk1999-10-301-1/+2
| | | | | | | | | "rw" argument, rather than hijacking B_{READ|WRITE}. Fix two bugs (physio & cam) resulting by the confusion caused by this. Submitted by: Tor.Egge@fast.no Reviewed by: alc, ken (partly)
* Give physio a makeover.phk1999-10-091-121/+54
| | | | | | | | | | | | | | | | | | | - Let physio take read/write compatible args and have it use uio->uio_rw to determine the direction. - physread/physwrite are now #defines for physio - Remove the inversly named minphys(), dev->si_iosize_max takes over. - Physio() always uses pbufs. - Fix the check for non page-aligned transfers, now only unaligned transfers larger than (MAXPHYS - PAGE_SIZE) get fragmented (only interesting for tapes using max blocksize). - General wash-and-clean of code. Constructive input from: bde
* Add a newline to "WARNING: %s maxphys = 0 ??" so it doesn't trip upgreen1999-10-091-1/+1
| | | | syslogd. Note of course it's simply much more polite and correct, too :)
* In some drivers we use two devices to be able to boot.sos1999-10-021-0/+1
| | | | | | | | | So if si_iosize_max is allready set, dont mess with it.. Also just log the problem with maxphys not being set once. designed by: phk tested by: sos
* Fix a problem relating to si_iosize_max which broke scsi devices.phk1999-10-021-0/+4
|
* Kill the cdevsw->d_maxio field.phk1999-09-221-7/+2
| | | | | | | | | d_maxio is replaced by the dev->si_iosize_max field which the driver should be set in all calls to cdevsw->d_open if it has a better idea than the system wide default. The field is a generic dev_t field (ie: not disk specific) so that tapes and other devices can use physio as well.
* Remove replace phygetvpbuf() with direct call to getpbuf();phk1999-09-121-19/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Use more compiler friendly test for overflow.phk1999-08-211-3/+3
| | | | Submitted by: bde
* Detect if the the offset used to read from a raw device loose bitsphk1999-08-211-2/+8
| | | | when converted to block number.
* Spring cleaning around strategy and disklabels/slices:phk1999-08-141-6/+5
| | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-19/+9
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-5/+5
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-071-1/+13
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* remove b_proc from struct buf, it's (now) unused.phk1999-05-061-2/+1
| | | | Reviewed by: dillon, bde
* Use the reference counted PHOLD()/PRELE() rather than P_PHYSIO.peter1999-04-061-9/+9
|
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-4/+4
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-2/+1
| | | | about unused variables, labels and other lint.
* Make struct buf->b_offset reflect the real byte offset which gotsos1998-08-191-2/+2
| | | | | in via the uio struct. This enables device drivers to use != DEV_BSIZE blocking on devices with wierd sector/block sizes (ie CDROM's).
* There is no such thing any more as "struct bdevsw".julian1998-07-041-26/+6
| | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind.
* Perhaps fix a problem that some drivers have that they don't properlydyson1998-04-041-2/+2
| | | | | initialize the b_kvasize element. This might fix some of the split I/O requests that some people have.
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-1/+3
| | | | used.
* In kern_physio.c fix tsleep priority messup.dyson1998-03-191-5/+1
| | | | | | | | | | | | | | | | | | | | | | In vfs_bio.c, remove b_generation count usage, remove redundant reassignbuf, remove redundant spl(s), manage page PG_ZERO flags more correctly, utilize in invalid value for b_offset until it is properly initialized. Add asserts for #ifdef DIAGNOSTIC, when b_offset is improperly used. when a process is not performing I/O, and just waiting on a buffer generally, make the sleep priority low. only check page validity in getblk for B_VMIO buffers. In vfs_cluster, add b_offset asserts, correct pointer calculation for clustered reads. Improve readability of certain parts of the code. Remove redundant spl(s). In vfs_subr, correct usage of vfs_bio_awrite (From Andrew Gallatin <gallatin@cs.duke.edu>). More vtruncbuf problems fixed.
* Add better support for larger I/O clusters, including larger physicaldyson1998-01-241-6/+35
| | | | | I/O. The support is not mature yet, and some of the underlying implementation needs help. However, support does exist for IDE devices now.
* Removed unused #includes.bde1997-09-021-2/+1
|
* Fixed some gratuitous ANSIisms.bde1997-08-261-4/+11
|
* Modify the scheduling policy to take into account disk I/O waitsdyson1997-08-091-1/+5
| | | | | | as chargeable CPU usage. This should mitigate the problem of processes doing disk I/O hogging the CPU. Various users have reported the problem, and test code shows that the problem should now be gone.
OpenPOWER on IntegriCloud