summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
Commit message (Collapse)AuthorAgeFilesLines
* do not try to free a mountpoint that we did not allocate.dillon2002-12-211-4/+9
| | | | X-MFC after: immediately
* Don't examine an un-initialized variable.phk2002-10-201-4/+0
| | | | Spotted by: FlexeLint.
* Be consistent about "static" functions: if the function is markedphk2002-09-281-1/+1
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Remove an errant debugging printf that got left in during my lastrwatson2002-09-271-1/+0
| | | | | | commit. Pointed out by: guido
* Apparently pxeboot passes in a mygateway of non-zero sin lengthrwatson2002-09-261-1/+6
| | | | | | | | | | from DHCP in the event that no gateway is returned from DHCP, breaking the assumption that we skip the routing insertion of the gateway if the sin length is zero. Check also for s_addr of 0 to avoid the "Oh no, adding my default route failed" panic, making it possible to pxeboot machines on segments without default routes. Arguably this could be a bug in pxeboot, or in the TUNABLE code, but this makes my boxes boot.
* - Lock access to the buf lists.jeff2002-09-251-2/+2
| | | | | - Use vrefcnt() where appropriate. - Add some locking asserts.
* Moved nfs_diskless setup code from autoconf.c to nfsclient/nfs_diskless.cjake2002-09-221-5/+8
| | | | | | | so that it is MI. Allow nfs_mountroot to return an error if the nfs_diskless struct is not valid, rather than panicing later on. Call nfs_setup_diskless() from nfs_mountroot if NFS_ROOT is defined, like bootpc_init(). Removed legacy root mount support for sparc64, and enabled NFS_ROOT by default.
* Now that we have a cached mount credential in struct mount, use it isteadphk2002-09-081-3/+0
| | | | of a private cached copy.
* Introduce typedefs for the member functions of struct vfsops and employphk2002-08-131-8/+5
| | | | | | | these in the main filesystems. This does not change the resulting code but makes the source a little bit more grepable. Sponsored by: DARPA and NAI Labs.
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-2/+3
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* Convert old style (type foo *)0 casts to NULLsdillon2002-07-111-4/+4
| | | | | PR: kern/40360 Requested by: Hiten PAndya via direct email
* More s/file system/filesystem/gtrhodes2002-05-161-2/+2
|
* We don't need the arp kludge any more.phk2002-04-281-7/+0
|
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-201-5/+5
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-6/+6
| | | | reference.
* Permit NFS filesystems to be forcibly unmounted when the server isiedowse2002-01-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | down, even if there are hung processes and the mount is non- interruptible. This works by having nfs_unmount call a new function nfs_nmcancelreqs() in the FORCECLOSE case. It scans the list of outstanding requests and marks as interrupted any requests belonging to the specified mount. Then it waits up to 30 seconds for all requests to terminate. A few other changes are necessary to support this: - Unconditionally set a socket timeout so that even hard mounts are guaranteed to occasionally check the R_SOFTTERM flag on requests. For hard mounts this flag can only be set by nfs_nmcancelreqs(). - Reject requests on a mount that is currently being unmounted. - Never grant the receive lock to a request that has been cancelled. This should also avoid an old problem where a forced NFS unmount could cause a crash; it occurred when a VOP on an unlocked vnode (usually VOP_GETATTR) was in progress at the time of the forced unmount.
* o Remove an errant ';' introduced in the last revision.alc2002-01-011-2/+1
| | | | o Remove an unused variable.
* o Remove premature use of nmp->nm_cred, it hasn't been initialized yet.rwatson2002-01-011-1/+1
|
* o Pass td into nfs_mountroot() to eliminate an XXX'd curthread use.rwatson2001-12-311-3/+2
| | | | | | | Since it's in the parent function anyway, might as well pass it another layer down. Obtained from: TrustedBSD Project
* o Remove premature leakage of use of td_ucred from base source tree:rwatson2001-12-311-3/+3
| | | | instead, use td->td_proc->p_ucred.
* o Make the credential used by socreate() an explicit argument torwatson2001-12-311-5/+12
| | | | | | | | | | | | | | socreate(), rather than getting it implicitly from the thread argument. o Make NFS cache the credential provided at mount-time, and use the cached credential (nfsmount->nm_cred) when making calls to socreate() on initially connecting, or reconnecting the socket. This fixes bugs involving NFS over TCP and ipfw uid/gid rules, as well as bugs involving NFS and mandatory access control implementations. Reviewed by: freebsd-arch
* Avoid passing the variable `tl' to functions that just use it foriedowse2001-12-181-2/+1
| | | | | | | | | | | | | temporary storage. In the old NFS code it wasn't at all clear if the value of `tl' was used across or after macro calls, but I'm fairly confident that the convention was to keep its use local. Each ex-macro function now uses a local version of this variable, so all of the double-indirection goes away. The only exception to the `local use' rule for `tl' is nfsm_clget(), which is left unchanged by this commit. Reviewed by: peter
* Allow users to use the 'nolockd' or -L options with mount_nfs in orderalfred2001-11-121-3/+3
| | | | | | to avoid the need for rpc.lockd to perform client locks. Using this option a user can revert back to using local locks for NFS mounts like we did before we had rpc.lockd.
* Change the vnode list under the mount point from a LIST to a TAILQdillon2001-10-231-2/+2
| | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days
* Make nfsm_dissect() have an obvious return value.peter2001-09-271-2/+2
|
* Add the magic marker so that loader and kldload(2) can find this inpeter2001-09-201-0/+4
| | | | module form automagically.
* Cleanup and split of nfs client and server code.peter2001-09-181-172/+94
| | | | This builds on the top of several repo-copies.
* KSE Milestone 2julian2001-09-121-34/+34
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Check the filehandle size when mounting.peter2001-07-301-0/+2
| | | | Obtained from: Constantine Sapuntzakis <csapuntz@openbsd.org>
* - Protect the mnt_vnode list with the mntvnode lock.jhb2001-06-281-5/+16
| | | | - Use queue(9) macros.
* Change the second argument of vflush() to an integer that specifiesiedowse2001-05-161-28/+4
| | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-6/+7
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Revert consequences of changes to mount.h, part 2.grog2001-04-291-2/+0
| | | | Requested by: bde
* Correct #includes to work with fixed sys/mount.h.grog2001-04-231-0/+2
|
* o Rather than arbitrarily construct a credential in the nfs_statfs()rwatson2001-04-051-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | VFS operation, make use of the calling process's credential. This solution may not be ideal (there are a number of other possible proposals, including making use of the proc0 credential, adding a credential argument to the VFSOP, and switching from a hard-coded ucred to a hard-coded nfscred), it is simple and appears to work. The arguments against using simply crget() are fairly strong: it is the only place in the code (other than a nearly identical invocation in ncp) where crget() is invoked, other than in the process credential creation code; as ucred becomes extensible, this use of crget() without appropriate context results in less and less meaningful credential data. The implementation here will probably be tweaked as a result of experimentation and further exploration of the requirements. In the mean-time, it allows progress to be made in ucred expansion for new security models without causing a crash every time df is used on an NFS mounted file system. This code has been interop tested against FreeBSD and Solaris NFS servers. While using the process credentials should not introduce interop problems, please let me know if any turn out to exist. Reviewed by: freebsd-arch
* Reviewed by: jlemonadrian2001-03-011-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount.
* In preparation for deprecating CIRCLEQ macros in favor of TAILQmckusick2000-11-141-1/+1
| | | | | macros which provide the same functionality and are a bit more efficient, convert use of CIRCLEQ's in NFS to TAILQ's.
* Don't scan for the "right" network interface by shooting in the dark.msmith2000-09-051-0/+3
| | | | | Assume that the nfs_diskless structure is correctly set up; the provider ought to be getting it right.
* Enhance reassignbuf(). When a buffer cannot be time-optimally inserteddillon2000-01-051-12/+24
| | | | | | | | | | | | | | | | | | | 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>
* Second pass commit to introduce new ACL and Extended Attribute systemrwatson1999-12-191-0/+1
| | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind
* Lock reporting and assertion changes.eivind1999-12-111-1/+1
| | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter
* Call bootpc_init before we try to mount an NFS root, if we're configuredmsmith1999-11-011-0/+6
| | | | | | to use BOOTP for NFS root discovery. The entire interface setup inside nfs_mountroot is evil, and should die.
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-09-111-0/+1
| | | | | | | | | VFS_CHECKEXP. Add fh(open|stat|stafs) syscalls to allow userland to query filesystems based on (network) filehandle. Obtained from: NetBSD
* All unimplemented VFS ops now have entries in kern/vfs_default.c that returnalfred1999-09-071-89/+5
| | | | | | | | | | | | | reasonable defaults. This avoids confusing and ugly casting to eopnotsupp or making dummy functions. Bogus casting of filesystem sysctls to eopnotsupp() have been removed. This should make *_vfsops.c more readable and reduce bloat. Reviewed by: msmith, eivind Approved by: phk Tested by: Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Various changes lifted from the OpenBSD cvs tree:peter1999-06-051-5/+5
| | | | | | | | | | | | | | | txdr_hyper and fxdr_hyper tweaks to avoid excessive CPU order knowledge. nfs_serv.c: don't call nfsm_adj() with negative values, windows clients could crash servers when doing a readdir of a large directory. nfs_socket.c: Use IP_PORTRANGE to get a priviliged port without a spin loop trying to bind(). Don't clobber a mbuf pointer or we get panics on a NFS3ERR_JUKEBOX error from a server when reusing a freed mbuf. nfs_subs.c: Don't loose st_blocks on NFSv2 mounts when > 2GB. Obtained from: OpenBSD
* Close a potential mbuf and/or mbuf cluster leak in the client-side NFSpeter1999-04-101-2/+2
| | | | statfs() code. Free the whole chain, not just the first one.
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-2/+1
| | | | | | | | | | 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 related to -Wall -Wcast-qualdillon1999-01-281-3/+3
|
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-8/+8
| | | | kernel compile
OpenPOWER on IntegriCloud