summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_bio.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* vinvalbuf(9): tlseep -> tsleep_nsec(9); ok millert@cheloha2019-07-251-7/+10
|
* getblk(9): tsleep(9) -> tsleep_nsec(9); ok visa@cheloha2019-07-191-4/+4
|
* Keep local definitions local.mpi2017-02-221-1/+3
| | | | "good work" deraadt@, ok visa@
* Convert to uiomove. From Martin Natano.stefan2016-02-131-7/+7
|
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* First step towards making uiomove() take a size_t size argument:miod2015-02-101-3/+3
| | | | | | | - rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
* delete a whole mess of unnecessary caddr_t caststedu2014-12-181-2/+2
|
* bzero -> memsettedu2014-11-141-2/+2
|
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-3/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Correct the handling of I/O of >=2^32 bytes and the ktracing there ofguenther2013-09-141-2/+2
| | | | | | by using size_t/ssize_t instead of int/u_int to handle I/O lengths in uiomove(), vn_fsizechk(), and ktrgenio(). Eliminate the always-zero 'error' argument to ktrgenio() at the same time.
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-111-4/+4
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* If the current offset is strictly less than the process filesizeguenther2012-07-111-17/+22
| | | | | | | rlimit, then a write that would take it over the limit should be clamped, making it a partial write. ok beck@
* No "\n" needed at the end of panic() strings.krw2010-08-071-3/+3
| | | | | | | Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
* Don't jump the queue if we have to wait on the client side becausebeck2010-04-121-5/+8
| | | | | | | the nfs_bufq is full - instead tsleep waiting for one of our nfsiod's to free up space for us in the queue so we can enqueue on the end. ok blambert@, tedu@, oga@
* make more bettah. instead of doing:oga2010-04-091-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | switch(type) { case VREG: /*something */ break; case VLNK: /* something */ break; default: panic("wtf?"); } do_something_that_doesn't_change_type(); switch(type) { case VREG: /* nowt */ break; case VLNK: n = 0; break; default: panic("wtf?"); } be a bit less silly and replace the second switch with: if (type == VLNK) n = 0; ok beck@, blambert@
* In the nfs bio functions, instead of looking at an invalid vnode type,oga2010-04-091-4/+4
| | | | | | | | | deciding to do nothing, printing about it and continuing along our merry way without even erroring the sodding buffer, just panic. by this point we are liked very fucked up anyway. found in either edmonton or stockholm then forgotten. ok beck@, blambert@
* antsyjsg2009-10-191-18/+6
| | | | | | no binary change apart from nfsm_reqhead() which is clearly correct. ok thib@
* Backout the asyncio/aiod change, as it causes buf's to get hung.thib2009-09-021-63/+16
| | | | | | problem noticed by deraadt@ ok beck@
* Garbage collect two variables that where set but unused.thib2009-08-271-2/+2
| | | | | Tiny spacing nit. Fix a typo, pointed out by miod@.
* introduce a flag member to struct nfs_aiod, and use flags instead of the exitthib2009-08-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | and worked members. nad_worked becomes NFSAIOD_WAKEUP, which is set after if an aiod was removed from the idle list and woken up by nfs_asyncio(). don't rely on tsleep wchans being unique, that is keep going back to sleep if woken up unless the NFSAIOD_WAKEUP flag is set. fix a divide by zero crash if nfs.vfs.iothreads is set to 0, as that can happen when we recalculate the maximum buf's to queue up for each aiod. in nfs_asyncio() set the nad_mnt to NULL before returning the aiod back to the idle list in the case where we have already queued up to many bufs, otherwise we trip an assertion. minimize the time we are holding the nfs_aiodl_mtx to only when we are inserting or removing from the lists, with the exception of nfs_set_naiod() as it would make the loops more complicated and its uncommon in any case. tested by myself and deraadt@ "fine with me" deraadt@
* make sure that an aiod has been removed from the nfs_aiods_idle listthib2009-08-261-2/+3
| | | | | | before inserting it back into the list. crashes debugged with help from deraadt@ who also tested this fix.
* Rework the way we do async I/O in nfs. Introduce separate buf queues forthib2009-08-201-16/+59
| | | | | | | | | | | | | | | | each mount, and when work is "found", peg an aiod to that mount todo the I/O. Make nfs_asyncio() a bit smarter when deciding when to do asyncio and when to force it sync, this is done by keeping the aiod's one two lists, an "idle" and an "all" list, so asyncio is only done when there are aiods hanging around todo it for us or are already pegged to the mount. Idea liked by at least beck@ (and I think art@). Extensive testing done by myself and jasper and a few others on various arch's. Ideas/Code from Net/Free. OK blambert@.
* Using the buf pointer returned from incore is a really bad idea.art2009-07-281-30/+12
| | | | | | | | | | | | | Even if we know that someone safely holds B_BUSY and will not modify the buf (as was the case in here), we still need to be sure that the B_BUSY will not be released while we fiddle with the buf. In this case, it was not safe, since copyout can sleep and whoever was writing out the buf could finish the write and release the buf which could then get recycled or unmapped while we slept. Always acquire B_BUSY ourselves, even when it might give a minor performance penalty. thib@ ok
* remove a comment thats part lie and part stating the obvious.thib2009-07-221-4/+1
| | | | ok blambert@
* (struct foo *)0 -> NULL, every where I could find it.thib2009-07-201-5/+5
| | | | OK blambert@
* - /dev/drum is long gone; sync comment with realityjasper2009-06-231-5/+2
| | | | ok thib@
* We don't count buffercache stats in the B_PHYS case, so fix nfs to notoga2009-03-191-5/+1
| | | | | | | | | | | | increment the num{read,write} and pending{read,write} statistics in that case, since biodone won't change them on completion. On another note, I'm not sure that we use physical buffers for swapping over nfs anymore, so this chunk may be superfluous. beck@ came up with the same diff "So anyway rather than me commiting it from my copy, I'm giving you the OK and the commit. since it officially makes you a buffer cache and NFS hacker };-)"
* Use a timespec instead of a time_t for the clients nfsnodethib2009-01-241-5/+6
| | | | | | | | mtime, gives us better granularity, helps with cache consistency. Idea lifted from NetBSD. OK blambert@
* Introduce a macro to invalidate the attributethib2009-01-191-8/+4
| | | | | | | cache instead of setting n_attrstamp to 0 directly. Lift the macro name from NetBSD. prompted by and OK blambert@
* o nfs_vinvalbuf() is always called with the intrflag as 1, and thenthib2008-08-091-34/+22
| | | | | | | | | | checks if the mount is actually interrutable, and if not sets it 0. remove this argument from nfs_vinvalbuf and just do the checking inside the function. o give nfs_vinvalbuf() a makeover so it looks nice. (spacing, casts, &c); o Actually pass PCATCH too tsleep() if the mount it interrutable. ok art@, blambert@
* After beck@ changed the way nfsiod's are notified of work, theblambert2008-08-081-2/+1
| | | | | | | nfs_iodwant array became unused. Garbage collect and free up a few bytes. ok thib@
* much more correct way of dealing with nfs pending reads/writesbeck2008-07-251-5/+10
| | | | ok thib@
* Correct cases of mishandling of pending reads and writes to preventbeck2008-07-231-1/+6
| | | | | | | | | | | | | them going negative - this consists of identifying a number of cases of IO not going through the buffer cache and marking those buffers with B_RAW - as well as fixing nfs_bio to show pending writes and reads through the buffer cache via NFS still has a problem with mishandling the counters I believe in the async/sync fallback case where counters stay positive which will be addressed seperately. ok tedu@ deraadt@
* Ensure each nfsiod can actually enqueue more than one asynchio - this mirrorsbeck2008-06-141-14/+13
| | | | | | | | | | | | the accidental situation that used to happen when it leaked buffers and allowed the syncer to do it, however this puts a limit on how much of the buffer cache it is allowed to consume to a sensible amount - improves nfs write performance since we don't have to do tons of them synch now. Modifies the existing code to use wakeup_one instead of cruft, and now all nfsiod's tsleep the same way. ok thib@ art@
* add a statistic bit to count how often we change async to syncthib2008-06-121-2/+5
| | | | | | you need to upgrade nfsstat and the relevant header files ok beck@
* if (something_complicated)art2008-06-121-10/+3
| | | | | | | | | | return (EIO); return (EIO); is kinda silly. Don't. Prettify a bit in the process. 'makes perfect sense' blambert@, ok thib@
* Actually return an error in nfs_asyncio() if we fail to processthib2008-06-121-13/+3
| | | | | | | the buf due too all of the nfs iod's being busy; this downgrades the write to a sync one and allows to handle this. ok art@, beck@
* Canonical for() -> queue.h FOREACH macro conversions.blambert2008-06-111-1/+2
| | | | | | | | | Also, it is historical practice to #include <sys/queue.h> when using queue.h macros. ok thib@ krw@ special thanks to krw@ for reminders vice violence
* pedro ok'd this ~3500 line diff which removes the vop argumentderaadt2007-06-011-7/+2
| | | | | "ap = v" comments in under 8 seconds, so it must be ok. and it compiles too.
* daddr_t -> daddr64_t;thib2007-06-011-5/+5
| | | | | | | Basically the usage of daddr_t was to math out arguments to nfs_getcacheblk, wich calls getblk(); ok deraadt@
* Kernel stack can be swapped. This means that stuff that's on the stackmiod2006-11-291-2/+1
| | | | | | | | | | should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
* move the declaration of nfsstats from nfs_bio.c tothib2006-11-011-2/+2
| | | | | | | nfs_subs.c so it gets pulled in for NFSSERVER only kernels. ok deraadt@,krw@
* Remove unused debug code that sneaked in by accident long agopedro2006-04-201-5/+1
|
* Fix reading large files; from NetBSD. Somehow this was overlookedotto2005-10-311-4/+5
| | | | when earlier merges were done. Fixes PR 4250. ok millert@ deraadt@
* NFS commit coalescion: instead of sending a commit for each block, coalescemarius2004-08-031-6/+22
| | | | | | | | these into larger ranges wherever possible. this should speed up NFS writes quite a bit. ok art@ millert@ pedro@ tedu@
* kqueue support for NFS, adapted from netbsd.marius2004-07-211-3/+12
| | | | ok art@ pedro@, "get it in" deraadt@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Kill a bunch more commons (very few left =)jason2003-05-131-1/+2
|
* Protect calls to biodone with splbio. Some functions calledart2002-05-211-2/+4
| | | | | | by biodone assume splbio (probably just on other filesystems) and some callbacks from b_iodone assume it too. It's just much safer. costa@ ok.
* There are NFS servers where it's possible to modify a symbolic link. Remove aggressive optimizationcsapuntz2002-02-081-19/+13
|