summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_syscalls.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure each nfsiod can actually enqueue more than one asynchio - this mirrorsbeck2008-06-141-11/+21
| | | | | | | | | | | | 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@
* NFSD_NEEDAUTH and NFSD_AUTHFAIL are never set, so cull code thatblambert2008-06-131-27/+2
| | | | | | | | depends on them being set. This should be the removal of the original return-to-userland-to-authenticate code that was apparently an unfinished experiment. ok thib@
* Bring biomem diff back into the tree after the nfs_bio.c fix went in.deraadt2008-06-121-2/+3
| | | | ok thib beck art
* back out biomem diff since it is not right yet. Doing very largederaadt2008-06-111-3/+2
| | | | | | | | file copies to nfsv2 causes the system to eventually peg the console. On the console ^T indicates that the load is increasing rapidly, ddb indicates many calls to getbuf, there is some very slow nfs traffic making none (or extremely slow) progress. Eventually some machines seize up entirely.
* Canonical for() -> queue.h FOREACH macro conversions.blambert2008-06-111-5/+4
| | | | | | | | | 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
* remove an unused variablethib2008-06-111-2/+1
|
* Buffer cache revampbeck2008-06-101-2/+3
| | | | | | | | | | | | | | | | 1) remove multiple size queues, introduced as a stopgap. 2) decouple pages containing data from their mappings 3) only keep buffers mapped when they actually have to be mapped (right now, this is when buffers are B_BUSY) 4) New functions to make a buffer busy, and release the busy flag (buf_acquire and buf_release) 5) Move high/low water marks and statistics counters into a structure 6) Add a sysctl to retrieve buffer cache statistics Tested in several variants and beat upon by bob and art for a year. run accidentally on henning's nfs server for a few months... ok deraadt@, krw@, art@ - who promises to be around to deal with any fallout
* plug potential mbuf leaks;thib2008-05-021-3/+8
| | | | | | | Parts from NetBSD; OK blambert@; tested by johan@, sthen@ and a few others.
* Close potential mbuf leak by iterating over the mbuf packet chainblambert2008-04-221-3/+8
| | | | | | | | and m_freem()'ing vice doing so only on the first packet. From a similar change in NetBSD. "yes please" thib@
* Remove now unused functions dealing with kerberosthib2007-10-141-192/+1
| | | | | | authentication. ok beck@
* MALLOC/FREE -> malloc/free + M_ZERO.thib2007-09-201-12/+9
| | | | | | Uneeded includes and casts... ok krw@
* replace magic number with a define.thib2007-06-251-2/+2
| | | | | | | (2 -> SHUT_RDWR in calls to soshutdown()). From Iruata Souza. ok deraadt@
* zap nfs_cltpsock; Unused since NQNFS died.thib2007-05-311-8/+2
| | | | ok beck@
* This is not the buffer you are looking for,thib2007-05-311-2/+2
| | | | | | vintage 6 year old NFS bug. ok beck@, looked at three times by art@
* Fix tree breakage. Variables only used inside #ifdef NFSSERVER shouldkrw2007-05-281-3/+3
| | | | | be defined inside same. ramdisk_cd (has nfs, but is not a server) compiles again.
* cleanup the nfssvc() system call.thib2007-05-271-244/+31
| | | | | | | | | | | | | | | | | | | | | * Remove alot of dead kerberos code like the options for NFSSVC_AUTHIN and NFSSVC_AUTHFAIL wich where originally to get the kerberos auth info into the kernel. (that hasnt worked for long, if ever.) Also remove some helper functions and associated goo, however theres still alot of it left. * Remove NFSSVC_BIOD, biod's where replaced with kernel threads a long time ago. * NFSSVC_MNTD wich was is NQNFS leftover. Update the man page and nfsd(8). nfssvc(2) besides being special has only one user in the tree nfsd(8), therefore no library bumps are needed. (discussed with deraadt@). ok beck@, "go a head" deraadt@ Tested by ckuethe@
* Kernel stack can be swapped. This means that stuff that's on the stackmiod2006-11-291-6/+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.
* typo, from Bret Lambertpedro2006-10-041-2/+2
|
* rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAITsturm2006-06-251-2/+2
| | | | requested by and ok pedro
* move vfs_busy() to rwlocks and properly hide the locking api from vfssturm2006-06-141-2/+2
| | | | ok tedu, pedro
* remove the simplelock argument from vfs_busy() which is currently notsturm2006-04-301-2/+2
| | | | | | used and will never be used this way in VFS requested by and ok pedro, ok krw, biorn
* No need for vfs_busy() and vfs_unbusy() to take a process pointerpedro2005-11-301-2/+2
| | | | anymore. Testing by jolan@, thanks.
* at long last, disable write gathering for v3. ok like everyonetedu2005-04-011-6/+7
|
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-5/+4
| | | | no change in compiler assembly output.
* kill netiso stuff here as well, millert okhenning2004-07-161-13/+1
|
* Minor fixes suggested by nordin@ and henning@tholo2004-06-251-8/+7
| | | | ok millert@
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-13/+22
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
* First step towards more sane time handling in the kernel -- this changestholo2004-06-211-5/+5
| | | | | | | | things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
* change arguments to suser. suser now takes the process, and a flagstedu2003-08-151-2/+2
| | | | | | | | | argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* make this at least compile ...mickey2003-05-071-2/+2
|
* Get rid of some commons.art2002-10-291-1/+7
|
* Just like getvnode, make getsock FREF the file so that we can't get awayart2002-08-231-2/+1
| | | | | | | with not refing it. Eyeballed by lurene@daemonkitty.net, fries@, nordin@ and fries@ Some additional cleanups by nordin@
* Use sizeof(array) instead of sizeof(array *) for bcopy length. ok deraadt@nordin2002-07-241-3/+3
|
* Change the locking on the mountpoint slightly. Instead of using mnt_lockart2002-07-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to get shared locks for lookup and get the exclusive lock only with LK_DRAIN on unmount and do the real exclusive locking with flags in mnt_flags, we now use shared locks for lookup and an exclusive lock for unmount. This is accomplished by slightly changing the semantics of vfs_busy. Old vfs_busy behavior: - with LK_NOWAIT set in flags, a shared lock was obtained if the mountpoint wasn't being unmounted, otherwise we just returned an error. - with no flags, a shared lock was obtained if the mountpoint was being unmounted, otherwise we slept until the unmount was done and returned an error. LK_NOWAIT was used for sync(2) and some statistics code where it isn't really critical that we get the correct results. 0 was used in fchdir and lookup where it's critical that we get the right directory vnode for the filesystem root. After this change vfs_busy keeps the same behavior for no flags and LK_NOWAIT. But if some other flags are passed into it, they are passed directly into lockmgr (actually LK_SLEEPFAIL is always added to those flags because if we sleep for the lock, that means someone was holding the exclusive lock and the exclusive lock is only held when the filesystem is being unmounted. More changes: dounmount must now be called with the exclusive lock held. (before this the caller was supposed to hold the vfs_busy lock, but that wasn't always true). Zap some (now) unused mount flags. And the highlight of this change: Add some vfs_busy calls to match some vfs_unbusy calls, especially in sys_mount. (lockmgr doesn't detect the case where we release a lock noone holds (it will do that soon)). If you've seen hangs on reboot with mfs this should solve it (I repeat this for the fourth time now, but this time I spent two months fixing and redesigning this and reading the code so this time I must have gotten this right).
* Remove some unused code for dealing with nfs over kerberos. No actual change,hin2002-06-111-18/+1
| | | | | | just some #ifdef'ed out code removed. ok deraadt@, art@ and csapuntz@
* First round of __P removal in sysmillert2002-03-141-5/+5
|
* Fix all users of getsock to use FREF/FRELE properly.art2002-02-121-2/+6
|
* theo doesn't like this codenate2002-02-101-2/+1
|
* - Rename FILE_{,UN}USE to FREF and FRELE. USE is a bad verb and we don't haveart2002-02-081-2/+2
| | | | | | | | | | | | | | the same semantics as NetBSD anyway, so it's good to avoid name collissions. - Always fdremove before freeing the file, not the other way around. - falloc FREFs the file. - have FILE_SET_MATURE FRELE the file (It feels like a good ortogonality to falloc FREFing the file). - Use closef as much as possible instead of ffree in error paths of falloc:ing functions. closef is much more careful with the fd and can deal with the fd being forcibly closed by dup2. Also try to avoid manually calling *fo_close when closef can do that for us (this makes some error paths mroe complicated (sys_socketpair and sys_pipe), but others become simpler (sys_open)).
* Add counting of temporary references to a struct file (as opposed to referencesart2002-02-051-3/+4
| | | | | | | | | | | | | | | from fd tables and other long-lived objects). This is to avoid races between using a file descriptor and having another process (with shared fd table) close it. We use a separate refence count so that error values from close(2) will be correctly returned to the caller of close(2). The macros for those reference counts are FILE_USE(fp) and FILE_UNUSE(fp). Make sure that the cases where closef can be called "incorrectly" (most notably dup2(2)) are handled. Right now only callers of closef (and {,p}read) use FILE_{,UN}USE correctly, more fixes incoming soon.
* Move nfs_norsvport out from behind #ifdef NFSSERVER so ramdiskhugh2002-01-201-2/+2
| | | | kernels with only NFSCLIENT defined can build.
* use queue.h macro'sericj2002-01-161-50/+53
| | | | remove register
* Add a new sysctl that removes the requirement for reserved ports to benate2002-01-111-1/+2
| | | | used by the nfs server.
* UBC was a disaster. It worked very good when it worked, but on someart2001-12-191-5/+38
| | | | | | | | | machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
* Merge in the unified buffer cache code as found in NetBSD 2001/03/10. Theart2001-11-271-38/+5
| | | | | | | code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>. Tested for the past few weeks by many developers, should be in a pretty stable state, but will require optimizations and additional cleanups.
* Remove creds from struct buf, move the creds that nfs need into the nfs node.art2001-11-151-3/+3
| | | | | | While in the area, convert nfs node allocation from malloc to pool and do some cleanups. Based on the UBC changes in NetBSD. niklas@ ok.
* Remove left-over code from cleaning that was causing servers to fail to respondcsapuntz2001-06-261-6/+3
|
* Remove NQNFScsapuntz2001-06-251-33/+99
|
* Change the B_DELWRI flag using buf_dirty and buf_undirty instead ofcsapuntz2001-02-231-3/+3
| | | | | | | | | manually twiddling it. This allows the buffer cache to more easily keep track of dirty buffers and decide when it is appropriate to speed up the syncer. Insipired by FreeBSD. Look over by art@