summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_syscalls.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct #includes to work with fixed sys/mount.h.grog2001-04-231-0/+2
|
* Implement client side NFS locks.alfred2001-04-171-0/+9
| | | | | Obtained from: BSD/os Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
* Switch to using a struct xucred instead of a struct xucred when notgreen2001-02-181-1/+7
| | | | | | | | | | | | | | | | | actually in the kernel. This structure is a different size than what is currently in -CURRENT, but should hopefully be the last time any application breakage is caused there. As soon as any major inconveniences are removed, the definition of the in-kernel struct ucred should be conditionalized upon defined(_KERNEL). This also changes struct export_args to remove dependency on the constantly-changing struct ucred, as well as limiting the bounds of the size fields to the correct size. This means: a) mountd and friends won't break all the time, b) mountd and friends won't crash the kernel all the time if they don't know what they're doing wrt actual struct export_args layout. Reviewed by: bde
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-12-211-2/+2
| | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-8/+5
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* This patchset fixes a large number of file descriptor race conditions.dillon2000-11-181-2/+5
| | | | | | | | | | | | Pre-rfork code assumed inherent locking of a process's file descriptor array. However, with the advent of rfork() the file descriptor table could be shared between processes. This patch closes over a dozen serious race conditions related to one thread manipulating the table (e.g. closing or dup()ing a descriptor) while another is blocked in an open(), close(), fcntl(), read(), write(), etc... PR: kern/11629 Discussed with: Alexander Viro <viro@math.psu.edu>
* 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
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-131-12/+0
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* Enhance reassignbuf(). When a buffer cannot be time-optimally inserteddillon2000-01-051-1/+1
| | | | | | | | | | | | | | | | | | | into vnode dirtyblkhd we append it to the list instead of prepend it to the list in order to maintain a 'forward' locality of reference, which is arguably better then 'reverse'. The original algorithm did things this way to but at a huge time cost. Enhance the append interlock for NFS writes to handle intr/soft mounts better. Fix the hysteresis for NFS async daemon I/O requests to reduce the number of unnecessary context switches. Modify handling of NFS mount options. Any given user option that is too high now defaults to the kernel maximum for that option rather then the kernel default for that option. Reviewed by: Alfred Perlstein <bright@wintelcom.net>
* M_PREPEND-related cleanups (unregisterifying struct mbuf *s).green1999-12-191-2/+1
|
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-0/+2
|
* Remove special case socket sharing code in order to allow nfsd todillon1999-11-111-12/+12
| | | | | | | bind IP addresses to udp/cltp sockets separately. PR: kern/13049 Reviewed by: David Malone <dwmalone@maths.tcd.ie>, freebsd-current
* Fix nfssvc_addsock() to not attempt to free a NULL socket structuredillon1999-11-081-3/+6
| | | | | | | | | when returning an error. Bug fix was extracted from the PR. The PR is not yet entirely resolved by this commit. PR: kern/13049 Reviewed by: Matt Dillon <dillon@freebsd.org> Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-09-111-41/+0
| | | | | | | | | VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Matt's NFS fixes.julian1999-06-231-2/+2
| | | | | | Submitted by: Matt Dillon Reviewed by: David Cross, Julian Elischer, Mike Smith, Drew Gallatin 3.2 version to follow when tested
* Suser() simplification:phk1999-04-271-3/+3
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Untangle the nfs send and receive queue locking a little. One lockpeter1999-02-251-20/+49
| | | | | | routine was [ab]used for two different things, and you couldn't tell from the wait channel which one had wedged. Catch a few things missing from NFS_NOSERVER.
* Move the declaration of the vfs.nfs sysctl node outside an ifdef so thatdfr1999-02-181-3/+3
| | | | | | it builds if NFS_NOSERVER is defined. Spotted by: Bruce Evans <bde@zeta.org.au>
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-1/+3
| | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-2/+2
| | | | kernel compile
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-2/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* Check for NULL pointer before freeing a struct sockaddr. m_freem() can handleluoqi1998-09-011-2/+3
| | | | NULL, buf free() can't.
* Yow! Completely change the way socket options are handled, eliminatingwollman1998-08-231-9/+21
| | | | | | another specialized mbuf type in the process. Also clean up some of the cruft surrounding IPFW, multicast routing, RSVP, and other ill-explored corners.
* For the on-the-wire protocol, u_long -> u_int32_t; long -> int32_t;peter1998-05-311-15/+15
| | | | | | | int -> int32_t; u_short -> u_int16_t. Also, use mode_t instead of u_short for storing modes (mode_t is a u_int16_t). Obtained from: NetBSD
* Use the new SB_UPCALL flag,peter1998-05-311-1/+4
| | | | Obtained from: NetBSD (but I changed the flag clear order in case).
* NFS Jumbo commit part 1. Cosmetic and structural changes only. The aimpeter1998-05-311-164/+162
| | | | | | of this part of commits is to minimize unnecessary differences between the other NFS's of similar origin. Yes, there are gratuitous changes here that the style folks won't like, but it makes the catch-up less difficult.
* Allow control of the attribute cache timeouts at mount time.peter1998-05-191-17/+20
| | | | | | We had run out of bits in the nfs mount flags, I have moved the internal state flags into a seperate variable. These are no longer visible via statfs(), but I don't know of anything that looks at them.
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-19/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Staticize.eivind1998-02-091-2/+2
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-3/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+3
|
* Don't call malloc(..., M_WAITOK) at splnet(). Doing so is oftenbde1997-11-241-4/+7
| | | | | | a mistake (since softnet interrupts may occur if malloc() waits), and doing it harmlessly but unnecessarily here interfered with detection of the mistaken cases.
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-6/+3
| | | | Found by: -Wunused
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-5/+3
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Removed unused #includes.bde1997-10-281-4/+1
|
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-3/+3
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Fix all areas of the system (or at least all those in LINT) to avoid storingwollman1997-08-161-28/+29
| | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
* Merge WebNFS changes from NetBSD.dfr1997-07-161-2/+3
| | | | Obtained from: NetBSD
* Clear nfs_iodwant[myiod] when the nfsiod process exits due to a signal.tegge1997-06-251-1/+2
|
* Don't keep addresses in mbuf chains. This should simplify the next rounddfr1997-05-131-2/+12
| | | | | | of network changes from Garret. Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Implement a separate control for write gathering on NFSv3. This is turneddfr1997-05-101-2/+10
| | | | | | | off for NFSv3 by default since write gathering seems to reduce performance for NFSv3 by up to 60%. Add sysctl knobs to control both variables.
* Allow NULL rpcs on non-privileged ports at all times to work around brokendfr1997-04-301-2/+3
| | | | | | | clients. PR: kern/3298 Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* The long-awaited mega-massive-network-code- cleanup. Part I.wollman1997-04-271-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following changes: 1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility glue for them is deleted, and the kernel will panic on boot if any are compiled in. 2) Certain protocol entry points are modified to take a process structure, so they they can easily tell whether or not it is possible to sleep, and also to access credentials. 3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt() call. Protocols should use the process pointer they are now passed. 4) The PF_LOCAL and PF_ROUTE families have been updated to use the new style, as has the `raw' skeleton family. 5) PF_LOCAL sockets now obey the process's umask when creating a socket in the filesystem. As a result, LINT is now broken. I'm hoping that some enterprising hacker with a bit more time will either make the broken bits work (should be easy for netipx) or dike them out.
* Add code that will reject nfs requests in teh kernel from nonprivilegedguido1997-03-271-1/+22
| | | | | | ports. This option will be automatically set/cleraed when mount is run without/with the -n option. Reviewed by: Doug Rabson
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of thebde1997-03-221-4/+4
| | | | | | form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
OpenPOWER on IntegriCloud