summaryrefslogtreecommitdiffstats
path: root/sys/nfs
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused include.jeff2002-03-201-1/+0
|
* Remove __P.alfred2002-03-201-10/+10
|
* When the old nfsm_adv() macro was moved to nfsm_adv_xx(), a '>='iedowse2001-12-311-1/+1
| | | | | | | | | | | must have been inadvertently changed to '>'. This broke nfsm_adv() in the case where the advancement count is equal to the amount of data remaining in the current mbuf. Instead of moving the current position N bytes forward, nfs_adv() could end up moving it back to N bytes from the start of the mbuf data. This should fix the client-side readdirplus problems that have been reported since September.
* Avoid passing the variable `tl' to functions that just use it foriedowse2001-12-182-10/+10
| | | | | | | | | | | | | 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
* Unwind some more macros. NFSMADV() was kinda silly since it was rightpeter2001-09-282-36/+42
| | | | | | | | | | next to equivalent m_len adjustments. Move the nfsm_subs.h macros into groups depending on which phase they are used in, since that affects the error recovery requirements. Collect some of the common error checking into a single macro as preparation for unwinding some more. Have nfs_rephead return a value instead of secretly modifying args. Remove some unused function arguments that were being passed around. Clarify nfsm_reply()'s error handling (I hope).
* Make nfsm_dissect() have an obvious return value.peter2001-09-272-33/+32
|
* Tidy up nfsm_build usage. This is only partially finished.peter2001-09-272-9/+8
|
* Oops, forgot to rm this last time.peter2001-09-261-564/+0
|
* Cleanup and split of nfs client and server code.peter2001-09-1827-25120/+133
| | | | This builds on the top of several repo-copies.
* nfs_strategy calls nfs_asyncio with td as NULL. So add a bandaid thatimp2001-09-181-1/+1
| | | | | | | | | | will pass NULL as the struct proc when td is NULL. This has stopped crashing on my machine. Note: The passing of NULL may be bogus, but I'll let others fix that problem. Reviewed by: jhb
* Sync some differences that were different between the copies of the filespeter2001-09-151-3/+3
| | | | that were in nfs/nfs.h and nfsserver/nfs.h in the p4 tree.
* KSE Milestone 2julian2001-09-1217-612/+621
| | | | | | | | | | | | | | 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
* Fix some signed/unsigned integer confusion, and add bounds checking ofkris2001-09-101-4/+4
| | | | | | | | arguments to some functions. Obtained from: NetBSD Reviewed by: peter MFC after: 2 weeks
* Pushdown Giant for nfs syscalls (nfssvc())dillon2001-08-311-12/+23
|
* Stupid error from my side in prev. commit: || -> &&ache2001-08-231-1/+1
|
* Implement l_len<0 per POSIX check.ache2001-08-231-4/+6
| | | | Check for valid l_whence too.
* Even better move: suppose that server is able to handle SEEK_END,ache2001-08-231-6/+6
| | | | | so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server
* Apparently SEEK_END locking not supported by NFS. Previous variantache2001-08-231-1/+5
| | | | returns EINVAL in that case, change it to EOPNOTSUPP.
* Move <machine/*> after <sys/*>ache2001-08-231-1/+2
| | | | Pointed by: bde
* adv. lock:ache2001-08-231-5/+5
| | | | | detect off_t overflow _before_ it occurse and return EOVERFLOW instead of EINVAL
* Fix a client-side memory leak in nfs_flush(). The code allocatesiedowse2001-08-011-2/+2
| | | | | | | | | | | | | a temporary array to store struct buf pointers if the list doesn't fit in a local array. Usually it frees the array when finished, but if it jumps to the 'again' label and the new list does fit in the local array then it can forget to free a previously malloc'd M_TEMP memory. Move the free() up a line so that it frees any previously allocated memory whether or not it needs to malloc a new array. Reviewed by: dillon
* Check the filehandle size when mounting.peter2001-07-301-0/+2
| | | | Obtained from: Constantine Sapuntzakis <csapuntz@openbsd.org>
* - Sort includes.jhb2001-07-041-5/+10
| | | | - Update vmmeter statistics for vnode pagein/pageouts in getpages/putpages.
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-043-18/+12
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* - Protect the mnt_vnode list with the mntvnode lock.jhb2001-06-283-9/+24
| | | | - Use queue(9) macros.
* Unlock the process returned from pfind() if it does not return NULL.jake2001-06-011-1/+4
| | | | | | | | This fixes a witness lock violation for nfssvc returning with locks held. Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr> PR: kern/27776
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Assert Giant is held by the caller rather than getting it and releasingjhb2001-05-231-10/+2
| | | | it in getpages/putpages.
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-231-1/+1
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-193-3/+32
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* 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-015-23/+35
| | | | | | | | | | | 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)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-35/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* Remove incorrect comment.alfred2001-04-291-1/+0
| | | | | Submitted by: quinot@inf.enst.fr <quinot@inf.enst.fr> PR: kern/26893
* Revert consequences of changes to mount.h, part 2.grog2001-04-2912-24/+0
| | | | Requested by: bde
* Correct #includes to work with fixed sys/mount.h.grog2001-04-2312-0/+24
|
* vnode_pager_freepage() is really vm_page_free() in disguise,alfred2001-04-191-3/+3
| | | | nuke vnode_pager_freepage() and replace all calls to it with vm_page_free()
* Implement client side NFS locks.alfred2001-04-176-7/+438
| | | | | Obtained from: BSD/os Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
* This patch removes the VOP_BWRITE() vector.phk2001-04-172-19/+23
| | | | | | | | | | | | | VOP_BWRITE() was a hack which made it possible for NFS client side to use struct buf with non-bio backing. This patch takes a more general approach and adds a bp->b_op vector where more methods can be added. The success of this patch depends on bp->b_op being initialized all relevant places for some value of "relevant" which is not easy to determine. For now the buffers have grown a b_magic element which will make such issues a tiny bit easier to debug.
* Create debug.hashstat.[raw]nchash and debug.hashstat.[raw]nfsnode topeter2001-04-111-0/+79
| | | | | | | | | | | enable easy access to the hash chain stats. The raw prefixed versions dump an integer array to userland with the chain lengths. This cheats and calls it an array of 'struct int' rather than 'int' or sysctl -a faithfully dumps out the 128K array on an average machine. The non-raw versions return 4 integers: count, number of chains used, maximum chain length, and percentage utilization (fixed point, multiplied by 100). The raw forms are more useful for analyzing the hash distribution, while the other form can be read easily by humans and stats loggers.
* 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
* Use the same API as the example code.peter2001-03-201-1/+1
| | | | | | | | | | Allow the initial hash value to be passed in, as the examples do. Incrementally hash in the dvp->v_id (using the official api) rather than add it. This seems to help power-of-two predictable filename trees where the filenames repeat on a power-of-two cycle and the directory trees have power-of-two components in it. The simple add then mask was causing things like 12000+ entry collision chains while most other entries have between 0 and 3 entries each. This way seems to improve things.
* Use a generic implementation of the Fowler/Noll/Vo hash (FNV hash).peter2001-03-172-29/+2
| | | | | | | | | | | | | | | | | Make the name cache hash as well as the nfsnode hash use it. As a special tweak, create an unsigned version of register_t. This allows us to use a special tweak for the 64 bit versions that significantly speeds up the i386 version (ie: int64 XOR int64 is slower than int64 XOR int32). The code layout is a little strange for the string function, but I was able to get between 5 to 10% improvement over the original version I started with. The layout affects gcc code generation choices and this way was fastest on x86 and alpha. Note that 'CPUTYPE=p3' etc makes a fair difference to this. It is around 45% faster with -march=pentiumpro on a p6 cpu.
* Dramatically improve the **lame** nfs_hash(). This is based on thepeter2001-03-171-8/+16
| | | | | | | | | | | | | Fowler / Noll / Vo Hash (http://www.isthe.com/chongo/tech/comp/fnv/). This improves hash coverage a *massive* amount. We were seeing one set of machines that were using 0.84% of their 131072 entry nfsnode hash buckets with maximum chain lengths of up to ~500 entries. The machine was spending nearly 100% of its time in 'system'. A test with this has pushed the coverage from a few perCent up to 91% utilization with a max chain length of 11. Submitted by: David Filo
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-1/+5
|
* 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.
* Fix lockup for loopback NFS mounts. The pipelined I/O limitations could bedillon2001-02-281-0/+8
| | | | | | | | | hit on the client side and prevent the server side from retiring writes. Pipeline operations turned off for all READs (no big loss since reads are usually synchronous) and for NFS writes, and left on for the default bwrite(). (MFC expected prior to 4.3 freeze) Testing by: mjacob, dillon
* Switch to using a struct xucred instead of a struct xucred when notgreen2001-02-182-2/+8
| | | | | | | | | | | | | | | | | 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
* Preceed/preceeding are not english words. Use precede and preceding.asmodai2001-02-181-2/+2
|
* Fix some problems that were introduced in revision 1.97. Insteadiedowse2001-02-091-46/+101
| | | | | | | | | | | | of returning an error code to the caller, NFS server op routines must themselves build an error reply and return 0 to the caller. This is achieved by replacing the erroneous return statements with code that jumps forward to the op function's reply code. We need to be careful to ensure that the 'struct mount' pointer is NULL though, so that the final vn_finished_write() call becomes a no-op. Reviewed by: mckusick, dillon
OpenPOWER on IntegriCloud