summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_syscalls.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Keep socket timeout intervals in nsecs and use them with tsleep_nsec(9).mpi2020-01-151-3/+3
| | | | | | | | | | | | | | Introduce and use TIMEVAL_TO_NSEC() to convert SO_RCVTIMEO/SO_SNDTIMEO specified values into nanoseconds. As a side effect it is now possible to specify a timeout larger that (USHRT_MAX / 100) seconds. To keep code simple `so_linger' now represents a number of seconds with 0 meaning no timeout or 'infinity'. Yes, the 0 -> INFSLP API change makes conversions complicated as many timeout holders are still memset()'d. Inputs from cheloha@ and bluhm@, ok bluhm@
* Convert infinite sleeps to tsleep_nsec(9).mpi2019-12-051-5/+5
| | | | ok jca@
* Pass the socket to sounlock(), this prepare the terrain for per-socketmpi2018-06-061-3/+3
| | | | | | locking. ok visa@, bluhm@
* Remove almost unused `flags' argument of suser().mpi2018-02-191-2/+2
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Use FREF() instead of rolling our own.mpi2018-01-311-2/+2
| | | | ok deraadt@, bluhm@
* Change sosetopt() to no longer free the mbuf it receives and changempi2017-09-011-1/+3
| | | | | | all the callers to call m_freem(9). Support from deraadt@ and tedu@, ok visa@, bluhm@
* Move the socket lock "above" sosetopt(), sogetopt() and sosplice().mpi2017-08-091-4/+4
| | | | | | | Protect the fields modifieds by sosetopt() and simplify the dance with the stars. ok bluhm@
* Add missing solock()/sounlock() dances around sbreserve().mpi2017-06-271-2/+4
| | | | | | While here document an abuse of parent socket's lock. Problem reported by krw@, analysis and ok bluhm@
* Remove useless splsoftnet().mpi2017-05-171-11/+3
| | | | | | | | | | Outside of USB, no code is executed in a softnet interrupt context. So what's protecting NFS data structures is the KERNEL_LOCK(). But more importantly, since r1.114 of nfs_socket.c, the 'softnet' thread is no longer executing NFS code. ok visa@
* Keep local definitions local.mpi2017-02-221-2/+10
| | | | "good work" deraadt@, ok visa@
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* pool_setipl for nfs poolsdlg2016-08-301-2/+4
| | | | ok natano@
* The nfsrv_descript_pl pool never gets used in interrupt context.kettenis2015-09-041-2/+2
| | | | ok deraadt@
* m_freem() can handle NULL, do not check for this condition beforehands.deraadt2015-07-151-7/+4
| | | | ok stsp mpi
* MFREE(9) is dead, long live m_freem(9)!mpi2015-07-081-2/+2
| | | | ok bluhm@, claudio@, dlg@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-2/+2
| | | | | | | | | | | | | | | receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
* Pass a thread pointer instead of its file descriptor table to getsock(9).mpi2015-05-061-2/+2
| | | | | | Diff from Vitaliy Makkoveev. Manpage tweak and ok millert@
* 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@
* add sizes for free(ptr, sizeof(*ptr)). use sizeof(*ptr) for malloc sizes.tedu2014-11-151-6/+6
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-4/+4
| | | | after discussions with beck deraadt kettenis.
* Fix bogus kthread_create() usage leading to wrong struct proc * pointermiod2013-11-031-4/+3
| | | | | usage in the nfs kthreads. Spotted by fgsch@, similar diff by guenther@, ok guenther@
* When we remove work from the nfs queue, wake up people waiting forbeck2013-06-251-2/+2
| | | | | | | | room to queue IO right away, rather than waiting for us to complete the IO we are working on and potentially do a many buffers DELWRI dance before waking up the sleepers so they can continue. ok guether@ tedu@
* Ensure NFS will only consume up to 1/4 of the available bufferbeck2012-12-101-3/+8
| | | | | | | mapping kva when busying up buffers in an nfsiod. (this in addition to the previous check for 1/4 of the total buffer space) This makes sparc installs work over nfsv2. ok deraadt@
* Add struct proc * argument to FRELE() and FILE_SET_MATURE() inguenther2012-04-221-3/+3
| | | | | | anticipation of further changes to closef(). No binary change. ok krw@ miod@ deraadt@
* Make sure we only initialize the nfsrv_descript_pl pool once.kettenis2010-12-051-3/+4
| | | | | | | | Re-initializing the pool everytime nfsd(8) terminates is very bad since it screws up the list of pools resulting in infinite loops when traversing that list. Issue found by Daniel Melameth. ok deraadt@
* No "\n" needed at the end of panic() strings.krw2010-08-071-2/+2
| | | | | | | Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
* another pair of files which relied on mbuf.h for pool.h; should be the last,blambert2010-07-311-1/+2
| | | | | | | | as the kernel now compiles w/o ``#include <sys/pool.h>'' in mbuf.h; removing that line, though, is for another day, as a userland program (systat, IIRC) fails to build without it there. ok krw@
* Don't jump the queue if we have to wait on the client side becausebeck2010-04-121-1/+3
| | | | | | | 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@
* antsyjsg2009-10-191-12/+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-1/+135
| | | | | | problem noticed by deraadt@ ok beck@
* Rework the way we do async I/O in nfs. Introduce separate buf queues forthib2009-08-201-135/+1
| | | | | | | | | | | | | | | | 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@.
* Remove the v2 writegather code. It did help alot back in the 80sthib2009-08-101-176/+131
| | | | | | | | | | but extensive performance benchmarking done by myself and jasper@ has shown that it doesn't help, at all - even on vaxens and in some cases it makes things significantly slower. "this excites me sexually" jetpack@ Tested by jasper@. OK blambert@
* (struct foo *)0 -> NULL, every where I could find it.thib2009-07-201-8/+8
| | | | OK blambert@
* For memory that gets allocated for every NFS request, pools make moreblambert2009-07-201-5/+10
| | | | | | sense than malloc. ok thib@, who says the puffin still gets it either way
* backout the buf_acquire() does the bremfree() since all callersthib2009-06-251-1/+2
| | | | | | | | | | where doing bremfree() befure calling buf_acquire(). This is causing us headache pinning down a bug that showed up when deraadt@ too cvs to current, and will have to be done anyway as a preperation for backouts. OK deraadt@
* All caller of buf_acquire were doing bremfree before the call.art2009-06-061-2/+1
| | | | | Just put it in the buf_acquire function. oga@ ok
* simplify argument list for nfssvc_nfsd()blambert2009-06-041-15/+10
| | | | ok thib@
* Place code to search for/sleep waiting for an nfs socket into its ownblambert2009-06-031-27/+53
| | | | | | code; makes the cleaned-up function much more legible. ok thib@
* Remove unused procnums (NQNFS leftovers) and cleanup.thib2009-05-301-4/+1
| | | | OK blambert@ sometime ago
* retire the nfs rtt log code, this isnt really all thatthib2009-05-221-47/+1
| | | | | | | usefull, and has been disabled for a long long time. Cleans house a bit. OK blambert@
* Remove cur_usec variable that is no longer used.bluhm2009-01-281-6/+1
| | | | ok blambert@
* Use a timespec for the server write deadline and procrastinationthib2009-01-241-6/+5
| | | | | | | | | timeouts. Rrids us of the ugly cur_sec variable, and some shadows. Also helps with granularity. Diff from blambert@ who asked me to commit this since he's away for some days and we wanted to put this in with the timespec changes in the nfsnode.
* remove function which only called nfssvc_iod(), and pass nfssvc_iod()blambert2009-01-181-16/+8
| | | | | | to kthread_create() ok thib@
* Replace the TRUE/FALSE defines with 1/0 respectively. This doesn'tthib2008-12-241-7/+4
| | | | | | | hurt readability and it was just plain annoying seeing them defined in every other .c file. OK blambert@
* move the declaration of nfsrv3_procs to nfs_syscalls.cthib2008-09-121-4/+31
| | | | ok 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@
* remove #ifndef nolint goothib2008-07-061-3/+2
| | | | ok blambert@
* Zap redundant prototype for nfsrv_zapsock();thib2008-07-061-3/+1
|
* Clean up some old dead code, mostly nqnfs and kerberos leftoversthib2008-07-051-13/+1
| | | | | | for uid goo, mostly zapping unused members from various structures. ok blambert@
* Label switch statement with /* FALLTHROUGH */; inspired by twoblambert2008-06-261-1/+3
| | | | | | wasted hours tracking down a phantom mbuf leak. ok thib@