summaryrefslogtreecommitdiff
path: root/sys/kern/kern_physio.c
Commit message (Collapse)AuthorAgeFilesLines
* Close the remaining user address mapping races for physicalMatthew Dillon2003-01-201-1/+11
| | | | | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days Notes: svn path=/head/; revision=109572
* Remove unused second argument from DEV_STRATEGY().Poul-Henning Kamp2003-01-031-1/+1
| | | | Notes: svn path=/head/; revision=108586
* Change iov_base's type from `char *' to the standard `void *'. AllMike Barcroft2002-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 *'. Notes: svn path=/head/; revision=104908
* More caddr_t removal, make fo_ioctl take a void * instead of a caddr_t.Alfred Perlstein2002-06-291-2/+2
| | | | Notes: svn path=/head/; revision=99009
* Use btodb() macro.Poul-Henning Kamp2002-05-181-7/+1
| | | | | | | Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96848
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-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 Notes: svn path=/head/; revision=60041
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-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. Notes: svn path=/head/; revision=58934
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()Poul-Henning Kamp2000-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. Notes: svn path=/head/; revision=58349
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-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. Notes: svn path=/head/; revision=58345
* Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for thePoul-Henning Kamp1999-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) Notes: svn path=/head/; revision=52644
* Give physio a makeover.Poul-Henning Kamp1999-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 Notes: svn path=/head/; revision=52066
* Add a newline to "WARNING: %s maxphys = 0 ??" so it doesn't trip upBrian Feldman1999-10-091-1/+1
| | | | | | | syslogd. Note of course it's simply much more polite and correct, too :) Notes: svn path=/head/; revision=52051
* In some drivers we use two devices to be able to boot.Søren Schmidt1999-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 Notes: svn path=/head/; revision=51878
* Fix a problem relating to si_iosize_max which broke scsi devices.Poul-Henning Kamp1999-10-021-0/+4
| | | | Notes: svn path=/head/; revision=51860
* Kill the cdevsw->d_maxio field.Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=51558
* Remove replace phygetvpbuf() with direct call to getpbuf();Poul-Henning Kamp1999-09-121-19/+1
| | | | Notes: svn path=/head/; revision=51197
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Use more compiler friendly test for overflow.Poul-Henning Kamp1999-08-211-3/+3
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=50125
* Detect if the the offset used to read from a raw device loose bitsPoul-Henning Kamp1999-08-211-2/+8
| | | | | | | when converted to block number. Notes: svn path=/head/; revision=50108
* Spring cleaning around strategy and disklabels/slices:Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=49771
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingKirk McKusick1999-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. Notes: svn path=/head/; revision=48225
* I got tired of seeing all the cdevsw[major(foo)] all over the place.Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=46676
* Introduce two functions: physread() and physwrite() and use these directlyPoul-Henning Kamp1999-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) Notes: svn path=/head/; revision=46625
* remove b_proc from struct buf, it's (now) unused.Poul-Henning Kamp1999-05-061-2/+1
| | | | | | | Reviewed by: dillon, bde Notes: svn path=/head/; revision=46580
* Use the reference counted PHOLD()/PRELE() rather than P_PHYSIO.Peter Wemm1999-04-061-9/+9
| | | | Notes: svn path=/head/; revision=45358
* This is a rather large commit that encompasses the new swapper,Matthew 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> Notes: svn path=/head/; revision=42957
* Nitpicking and dusting performed on a train. Removes trivial warningsPoul-Henning Kamp1998-10-251-2/+1
| | | | | | | about unused variables, labels and other lint. Notes: svn path=/head/; revision=40648
* Make struct buf->b_offset reflect the real byte offset which gotSøren Schmidt1998-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). Notes: svn path=/head/; revision=38438
* There is no such thing any more as "struct bdevsw".Julian Elischer1998-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. Notes: svn path=/head/; revision=37389
* Perhaps fix a problem that some drivers have that they don't properlyJohn Dyson1998-04-041-2/+2
| | | | | | | | initialize the b_kvasize element. This might fix some of the split I/O requests that some people have. Notes: svn path=/head/; revision=35021
* Moved some #includes from <sys/param.h> nearer to where they are actuallyBruce Evans1998-03-281-1/+3
| | | | | | | used. Notes: svn path=/head/; revision=34924
* In kern_physio.c fix tsleep priority messup.John 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. Notes: svn path=/head/; revision=34694
* Add better support for larger I/O clusters, including larger physicalJohn Dyson1998-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. Notes: svn path=/head/; revision=32724
* Removed unused #includes.Bruce Evans1997-09-021-2/+1
| | | | Notes: svn path=/head/; revision=29041
* Fixed some gratuitous ANSIisms.Bruce Evans1997-08-261-4/+11
| | | | Notes: svn path=/head/; revision=28767
* Modify the scheduling policy to take into account disk I/O waitsJohn Dyson1997-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. Notes: svn path=/head/; revision=28013
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Fix a problem that caused system crashes after physio. This problemJohn Dyson1996-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. Notes: svn path=/head/; revision=16752
* devsw tables are now arrays of POINTERS to struct [cb]devswJulian Elischer1995-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 Notes: svn path=/head/; revision=12813
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-1/+3
| | | | Notes: svn path=/head/; revision=12662
* Completed function declarations and/or added prototypes.Bruce Evans1995-12-021-3/+3
| | | | Notes: svn path=/head/; revision=12577
* Implement read/write to kernel space - I use this for a self-loading/Peter Wemm1995-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.) Notes: svn path=/head/; revision=12498
* Fix benign type mismatches in devsw functions. 82 out of 299 devswBruce Evans1995-09-081-3/+3
| | | | | | | functions were wrong. Notes: svn path=/head/; revision=10624
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8876
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'Bruce Evans1995-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. Notes: svn path=/head/; revision=7090
* These changes embody the support of the fully coherent merged VM buffer cache,David Greenman1995-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 Notes: svn path=/head/; revision=5455
* While in the real world, I had a bad case of being swapped out for a lot ofPoul-Henning Kamp1994-09-251-3/+1
| | | | | | | | | | | cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks. Notes: svn path=/head/; revision=3098
* Fix up some sloppy coding practices:Garrett Wollman1994-08-181-2/+1
| | | | | | | | | | | | | | | - Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter. Notes: svn path=/head/; revision=2112
* Detect the "EOF" condition. Specifically, end of partition.David Greenman1994-08-081-1/+4
| | | | | | | Submitted by: Bruce Evans Notes: svn path=/head/; revision=1947