summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.c
Commit message (Collapse)AuthorAgeFilesLines
* Add bwillwrite to all system calls that create things in the filesystem.mckusick2000-01-101-0/+9
| | | | Benchmarks that create huge trees of empty files overwhelm the buffer cache.
* Second pass commit to introduce new ACL and Extended Attribute systemrwatson1999-12-191-2/+193
| | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-28/+54
|
* Remove accidental pollution unrelated to previous commit. The issuedillon1999-12-121-2/+1
| | | | here is real but has not yet been discussed with Eivind.
* Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC todillon1999-12-121-1/+2
| | | | | | | | | | | | | | | | | madvise(). This feature prevents the update daemon from gratuitously flushing dirty pages associated with a mapped file-backed region of memory. The system pager will still page the memory as necessary and the VM system will still be fully coherent with the filesystem. Modifications made by other means to the same area of memory, for example by write(), are unaffected. The feature works on a page-granularity basis. MAP_NOSYNC allows one to use mmap() to share memory between processes without incuring any significant filesystem overhead, putting it in the same performance category as SysV Shared memory and anonymous memory. Reviewed by: julian, alc, dg
* struct mountlist and struct mount.mnt_list have no business beingphk1999-11-201-11/+9
| | | | | | | | | | a CIRCLEQ. Change them to TAILQ_HEAD and TAILQ_ENTRY respectively. This removes ugly mp != (void*)&mountlist comparisons. Requested by: phk Submitted by: Jake Burkholder jake@checker.org PR: 14967
* Ensure that garbage from the kernel stack does not wind up beingdillon1999-11-181-0/+2
| | | | | | | | returned to user mode in the spare fields of the stat structure. PR: kern/14966 Reviewed by: dillon@freebsd.org Submitted by: Kelly Yancey kbyanc@posi.net
* Commit the remaining part of PR14914:phk1999-11-161-9/+11
| | | | | | | | | | | Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY structures for list operations. This patch makes all list operations in sys/kern use the queue(3) macros, rather than directly accessing the *Q_{HEAD,ENTRY} structures. Reviewed by: phk Submitted by: Jake Burkholder <jake@checker.org> PR: 14914
* Remove WILLRELE from VOP_SYMLINKeivind1999-11-131-0/+2
| | | | | | Note: Previous commit to these files (except coda_vnops and devfs_vnops) that claimed to remove WILLRELE from VOP_RENAME actually removed it from VOP_MKNOD.
* Fix style bugs from last commiteivind1999-11-131-6/+4
|
* Remove WILLRELE from VOP_RENAMEeivind1999-11-121-0/+6
|
* Most modern OSs have the ability to flag certain mounts as ones tojulian1999-11-011-2/+2
| | | | | | | | | | | | | | be ignored by default by the df(1) program. This is used mostly to avoid stat()-ing entries that do not represent "real" disk mount points (such as those made by an automounter such as amd.) It is also useful not to have to stat() these entries because it takes longer to report them that for other file systems, being that these mount points are served by a user-level file server and resulting in several context switches. Worse, if the automounter is down unexpectedly, a causal df(1) will hang in an interruptible way. PR: kern/9764 Submitted by: Erez Zadok <ezk@cs.columbia.edu>
* Trim unused options (or #ifdef for undoc options).peter1999-10-111-1/+0
| | | | Submitted by: phk
* Before we start to mess with the VFS name-cache clean things up a little bit:phk1999-10-031-95/+0
| | | | Isolate the namecache in its own file, and give it a dedicated malloc type.
* Remove v_maxio from struct vnode.phk1999-09-291-0/+1
| | | | | | Replace it with mnt_iosize_max in struct mount. Nits from: bde
* Fix a hole in jail(2).phk1999-09-251-0/+4
| | | | Noticed by: Alexander Bezroutchko <abb@zenon.net>
* Seperate the export check in VFS_FHTOVP, exports are now checked viaalfred1999-09-111-2/+291
| | | | | | | | | 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
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* Go back to using microtime() to get the timestamps for {f,l,}utimes(path,jdp1999-08-221-2/+3
| | | | | | | | NULL) for now. Bruce says I jumped the gun with my change in revision 1.131, or maybe it should use nanotime(), or maybe it shouldn't be decided in the VFS layer at all. I'm leaving it with the old behavior until the Trans-Pacific Internet Vulcan Mind Meld yields fuller understanding.
* Use the new vfs_timestamp() function to create the timestamps usedjdp1999-08-221-43/+46
| | | | | | | | by utimes(path, NULL). This gives them the same precision as the timestamps produced by write operations. Do likewise for lutimes() and futimes(). Suggested by bde.
* Replace a redundant vfs_object_create() call (already done in vn_open)alfred1999-08-121-3/+4
| | | | | | with a KASSERT. Reviewed by: Eivind, Alan Cox
* Fix fd race conditions (during shared fd table usage.) Badfileops isgreen1999-08-041-3/+3
| | | | | | | | | | | | now used in f_ops in place of NULL, and modifications to the files are more carefully ordered. f_ops should also be set to &badfileops upon "close" of a file. This does not fix other problems mentioned in this PR than the first one. PR: 11629 Reviewed by: peter
* o Typo in prior version kept it from compiling (blush).imp1999-08-041-6/+9
| | | | | | | Noticed by: Nobody! o Add comment about why we restrict chflags to root for devices. o nit noticed by bde wrt return values.
* brucify:imp1999-08-031-6/+6
| | | | | | | | | | | | | | | o use suser_xxx rather than suser to support JAIL code. o KNF comment convention o use vp->type rather than vaddr.type and eliminate call to VOP_GETATTR. Bruce says that vp->type is valid at this point. Submitted by: bde. Not fixed: o return (value) o Comment needs to be longer and more explicit. It will be after the advisory.
* Only allow root to set file flags on devices.imp1999-08-021-1/+8
|
* lutimes() bug: FOLLOW should be NOFOLLOW for this one.green1999-07-291-2/+2
| | | | Submitted by: Dan Nelson <dnelson@emsphone.com>
* Add sysctl and support code to allow directories to be VMIO'd. The defaultalc1999-07-261-2/+2
| | | | | | setting for the sysctl is OFF, which is the historical operation. Submitted by: dillon
* This Implements the mumbled about "Jail" feature.phk1999-04-281-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Suser() simplification:phk1999-04-271-13/+13
| | | | | | | | | | | | | | | | | | | 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.
* Add a sysctl variable which can help stop chroot(2) escapes.phk1999-03-231-1/+45
| | | | | | | | | | | | | | | kern.chroot_allow_open_directories = 0 chroot(2) fails if there are open directories. kern.chroot_allow_open_directories = 1 (default) chroot(2) fails if there are open directories and the process is subject of a previous chroot(2). kern.chroot_allow_open_directories = anything else filedescriptors are not checked. (old behaviour). I'm very interested in reports about software which breaks when running with the default setting.
* Slight cleanup of code resurected for union mounts..julian1999-03-031-33/+35
| | | | Submitted by: Tony Finch <dot@dotat.at>
* Fix code for union mountsjulian1999-02-271-1/+23
| | | | | | Accidentally deleted by peter when he extracted the unionfs stuff in 1.109 Submitted by: Tony Finch <dot@dotat.at>
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-251-1/+2
|
* * 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)
* Use suser() to determine super-user-ness.phk1999-01-301-26/+16
| | | | | | Collapse some duplicated checks. Reviewed by: bde
* Fix warnings related to -Wall -Wcast-qualdillon1999-01-281-1/+3
|
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-58/+58
| | | | kernel compile
* Go back to only supporting revoke() for bdevs and cdevs. It is verybde1999-01-241-1/+5
| | | | | | | | buggy for fifos, and no one seems to have investigated its behaviour on other types of files. It has been broken since the Lite2 merge in rev.1.54. Nagged about by: Brian Feldman (green@unixhelp.org)
* Remove the 'waslocked' parameter to vfs_object_create().eivind1999-01-051-2/+2
|
* PR: kern/8965dillon1998-12-121-1/+3
| | | | | | | | | Obtained from: Stephen Clawson <sclawson@cs.utah.edu> Wakeup anyone waiting on a mount point prior to returning from umount, whether an error occurs or not. Fixes a stat/NFS-umount race and other potential future problems. Fix taken from bug/pr which also indicated that the same fix has already been applied to OpenBSD and NetBSD.
* make mount(2) automatically kldload modules if the requested filesystempeter1998-11-031-3/+32
| | | | isn't present.
* Change the #ifdef UNION code into a callable hook. Arrange to have thispeter1998-11-031-114/+15
| | | | set up when unionfs is present, either statically or as a kld module.
* The last argument to vm_object_page_clean() are now bit flags, rather thanpeter1998-10-311-2/+2
| | | | | | | | | | | | the old true/false. While here, have vfs_msync() only call vm_object_page_clean() with OBJPC_SYNC if called with MNT_WAIT flags. vfs_msync() is called at unmount time (with MNT_WAIT) and from the syncer process (formerly update). This should make dirty mmap writebacks a little less nasty. I have tested this a little with SOFTUPDATES enabled, but I don't normally use it since I've been badly burned too many times.
* Eliminate a race in VOP_FSYNC() when softupdates is enabled.luoqi1998-09-241-36/+15
| | | | | | | | | | Submitted by: Kirk McKusick <mckusick@McKusick.COM> Two minor changes are also included, 1. Remove gratuitious checks for error return from vn_lock with LK_RETRY set, vn_lock should always succeed in these cases. 2. Back out change rev. 1.36->1.37, which unnecessarily makes async mount a little more unstable. It also keeps us in sync with other BSDs. Suggested by: Bruce Evans <bde@zeta.org.au>
* Don't keep the underlying directory locked while performing the filetegge1998-09-101-4/+16
| | | | | system specific VFS_MOUNT operation. PR: 1067
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-2/+2
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* Reset MNT_ASYNC flag if needed if unmount() should fail.dg1998-07-031-1/+4
| | | | Submitted by: Paul Saab <paul@mu.org>
* Remove some junk left over from a previous commit.dyson1998-06-081-6/+1
| | | | Submitted by: phk
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
OpenPOWER on IntegriCloud