aboutsummaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_lock.c
Commit message (Collapse)AuthorAgeFilesLines
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-2/+3
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Fix the nlm so that it no longer depends on the regularRick Macklem2011-01-031-1/+1
| | | | | | | | | | | nfs client and, as such, can be loaded for the experimental nfs client without the regular client. Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=216931
* Modify the NFS clients and the NLM so that the NLM can be usedRick Macklem2010-10-191-5/+7
| | | | | | | | | | | | | | | | by both clients. Since the NLM uses various fields of the nfsmount structure, those fields were extracted and put in a separate nfs_mountcommon structure stored in sys/nfs/nfs_mountcommon.h. This structure also has a function pointer for a function that extracts the required information from the mount point and nfs vnode for that particular client, for information stored differently by the clients. Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=214048
* Move sys/nfsclient/nfs_lock.c into sys/nfs and build it as a separateRick Macklem2010-07-241-0/+396
| | | | | | | | | | | | | | module that can be used by both the regular and experimental nfs clients. This fixes the problem reported by jh@ where /dev/nfslock would be registered twice when both nfs clients were used. I also defined the size of the lm_fh field to be the correct value, as it should be the maximum size of an NFSv3 file handle. Reviewed by: jh MFC after: 2 weeks Notes: svn path=/head/; revision=210455
* Cleanup and split of nfs client and server code.Peter Wemm2001-09-181-286/+0
| | | | | | | This builds on the top of several repo-copies. Notes: svn path=/head/; revision=83651
* KSE Milestone 2Julian Elischer2001-09-121-7/+10
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=83366
* Stupid error from my side in prev. commit: || -> &&Andrey A. Chernov2001-08-231-1/+1
| | | | Notes: svn path=/head/; revision=82213
* Implement l_len<0 per POSIX check.Andrey A. Chernov2001-08-231-4/+6
| | | | | | | Check for valid l_whence too. Notes: svn path=/head/; revision=82204
* Even better move: suppose that server is able to handle SEEK_END,Andrey A. Chernov2001-08-231-6/+6
| | | | | | | | so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server Notes: svn path=/head/; revision=82194
* Apparently SEEK_END locking not supported by NFS. Previous variantAndrey A. Chernov2001-08-231-1/+5
| | | | | | | returns EINVAL in that case, change it to EOPNOTSUPP. Notes: svn path=/head/; revision=82193
* Move <machine/*> after <sys/*>Andrey A. Chernov2001-08-231-1/+2
| | | | | | | Pointed by: bde Notes: svn path=/head/; revision=82190
* adv. lock:Andrey A. Chernov2001-08-231-5/+5
| | | | | | | | detect off_t overflow _before_ it occurse and return EOVERFLOW instead of EINVAL Notes: svn path=/head/; revision=82174
* Unlock the process returned from pfind() if it does not return NULL.Jake Burkholder2001-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 Notes: svn path=/head/; revision=77563
* o Merge contents of struct pcred into struct ucred. Specifically, add theRobert Watson2001-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 Notes: svn path=/head/; revision=77183
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-3/+5
| | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=76166
* Revert consequences of changes to mount.h, part 2.Greg Lehey2001-04-291-2/+0
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=76117
* Correct #includes to work with fixed sys/mount.h.Greg Lehey2001-04-231-0/+2
| | | | Notes: svn path=/head/; revision=75858
* Implement client side NFS locks.Alfred Perlstein2001-04-171-0/+269
Obtained from: BSD/os Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org Notes: svn path=/head/; revision=75631