summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_physio.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Fix a problem that caused system crashes after physio. This problemdyson1996-06-261-6/+11
| | | | | | | | | was due to non-aligned 64K transfers taking 17 pages. We currently do not support >16 page transfers. The transfer is unfortunately truncated, but since buffers are usually malloced, this is a problem only once in a while. Savecore is a culprit, but tar/cpio usually aren't. This is NOT the final fix (which is likely a bouncing scheme), but will at least keep the system from crashing.
* devsw tables are now arrays of POINTERS to struct [cb]devswjulian1995-12-131-3/+3
| | | | | | | | | seems to work hre just fine though I can't check every file that changed due to limmited h/w, however I've checked enught to be petty happy withe hte code.. WARNING... struct lkm[mumble] has changed so it might be an idea to recompile any lkm related programs
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+3
|
* Completed function declarations and/or added prototypes.bde1995-12-021-3/+3
|
* Implement read/write to kernel space - I use this for a self-loading/peter1995-11-281-11/+16
| | | | | | | self-decompressing ram disk that I'm fiddling with.. (Note, this depends on the various syscalls having correctly set uio_segflag before calling physio - I've checked and they look correct.)
* Fix benign type mismatches in devsw functions. 82 out of 299 devswbde1995-09-081-3/+3
| | | | functions were wrong.
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-2/+2
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* These changes embody the support of the fully coherent merged VM buffer cache,dg1995-01-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman
OpenPOWER on IntegriCloud