summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
AgeCommit message (Collapse)Author
2006-06-25rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAITNikolay Sturm
requested by and ok pedro
2006-06-14move vfs_busy() to rwlocks and properly hide the locking api from vfsNikolay Sturm
ok tedu, pedro
2006-05-27remove useless error check and irritating commentNikolay Sturm
ok pedro
2006-04-30remove the simplelock argument from vfs_busy() which is currently notNikolay Sturm
used and will never be used this way in VFS requested by and ok pedro, ok krw, biorn
2006-04-19Remove unused mount list simple_lock() gooPedro Martelletto
2006-03-26do per file io accounting and show that in fstat as well; pedro@ marco@ okMichael Shalayeff
2006-01-07p_dupfd need only be -1, nothing else. but this is nothing like what aaron ↵Theo de Raadt
has coming...
2005-11-30No need for vfs_busy() and vfs_unbusy() to take a process pointerPedro Martelletto
anymore. Testing by jolan@, thanks.
2005-11-27Don't set MNT_UPDATE and MNT_RELOAD before acquiring the mount pointPedro Martelletto
lock. Fixes a race as seen on PR kern/4915. Okay miod@ and joris@, tested by krw@ and hshoexer@, thanks.
2005-11-19Remove unnecessary lockmgr() archaism that was costing too much in termsPedro Martelletto
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
2005-11-08Use ANSI function declarations and deregister, no binary changePedro Martelletto
2005-07-03Extended Attributes was a piece to get to ACLs, however ACLs have notDale Rahn
been worked on, so EA is pointless. Also the code is not enabled in GENERIC so it is not being tested or maintained.
2005-06-17remove undelete syscallTodd C. Miller
2005-05-27remove some dead code.marius eriksen
ok pedro@
2005-05-27remove references of VOP_WHITEOUT from the kernel, okay millert@Pedro Martelletto
2005-05-27prepare the removal of sys_undelete(), make it a stub, okay millert@Pedro Martelletto
2005-05-26RIP stackable filesystems, ok marius@ tedu@, discussed with deraadt@Pedro Martelletto
2005-05-24when a device vnode associated with a mount point disappears, mark thePedro Martelletto
filesystem as doomed and unmount it
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-09-16check for VBAD vnodes on getvnode(). ok andreas@, tedu@ and marius@Pedro Martelletto
2004-08-05don't attempt to put processes back in a directory after unmount.Ted Unangst
it could never always work, and worse, may cause other bugs/crashes.
2004-07-22remove p arg from fdplockTed Unangst
2004-07-18return EINVAL if ftruncate(2) is passed a negative offsetAnil Madhavapeddy
ok millert@, miod@, marius@
2004-07-13Change mode_t and nlink_t from 16bit to 32bit. This allows us toTodd C. Miller
use mode_t in syscalls.master and to use mode_t in more places in the kernel. It also makes lint much more useful on kernel code. I've also added a placeholder for st_birthtime to make a UFS2 import easier at some future date. Requested by and OK deraadt@
2004-07-03if vinvalbuf() fails, unlock the vnode and release it. ok marius@Pedro Martelletto
2004-06-21First step towards more sane time handling in the kernel -- this changesThorsten Lockert
things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
2004-05-14use pool for namei pathbuf. testing ok millert@ tdeval@Ted Unangst
2004-05-10when doing user mounts, inherit the MNT_NOEXEC flag from the coveredPedro Martelletto
vnode's mount point. this makes it impossible for a user to bypass the noexec protection of a mount point by null-mounting it on top of itself. ok tedu@ millert@
2004-04-13useless caddr_t cast removal. same md5s.Ted Unangst
2004-01-06lock filedesc before manipulating. avoids some rare races.Ted Unangst
testing for quite some time by brad + otto
2003-09-01match syscallargs comments with realityHenning Brauer
from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
2003-08-15change arguments to suser. suser now takes the process, and a flagsTed Unangst
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
2003-07-18check v_mount for NULL before using. ok art@Ted Unangst
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-06attempt to put a process's cwd back in place after a forced umount.Ted Unangst
won't always work, but it's the best we can do for now. this covers at least some of the failure cases the previous commit to vfs_lookup.c checks for. ok weingart@
2003-05-05fix test for restoring mnt_syncer in dounmount.Ted Unangst
ok and input csapuntz@
2003-05-01several related changes:Ted Unangst
vfs_subr.c: add a missing simple_lock_init for vnode interlock try to avoid reclaiming locked or layered vnodes initialize vnlock pointer to NULL remove old code to free vnlock, never used lockinit the new vnode lock vfs_syscalls.c: support for VLAYER flag vnode_if.sh: support for splitting VDESC flags vnode_if.src: split VDESC flags WILLPUT is the combination of WILLRELE and WILLUNLOCK most uses for WILLRELE become WILLPUT vnode.h: add v_lock to struct vnode add VLAYER flag update for new VDESC flags
2003-04-11zombies can't live allproc list. art fixed the real problem a while ago.Ted Unangst
2003-04-10don't try to update directories on zombies. pr2030. ok artTed Unangst
2002-10-02Check for negative values. Inspiration from tedu <grendel@zeitbombe.org>.Thomas Nordin
ok deraadt@ and art@
2002-08-23Cleanup change. Since almost all callers (except one) of getvnode did a FREFArtur Grabowski
on the returned file, do the FREF inside getvnode so that people can't get away with avoiding FREF and FRELE. Eyeballed by various people.
2002-07-12Change the locking on the mountpoint slightly. Instead of using mnt_lockArtur Grabowski
to get shared locks for lookup and get the exclusive lock only with LK_DRAIN on unmount and do the real exclusive locking with flags in mnt_flags, we now use shared locks for lookup and an exclusive lock for unmount. This is accomplished by slightly changing the semantics of vfs_busy. Old vfs_busy behavior: - with LK_NOWAIT set in flags, a shared lock was obtained if the mountpoint wasn't being unmounted, otherwise we just returned an error. - with no flags, a shared lock was obtained if the mountpoint was being unmounted, otherwise we slept until the unmount was done and returned an error. LK_NOWAIT was used for sync(2) and some statistics code where it isn't really critical that we get the correct results. 0 was used in fchdir and lookup where it's critical that we get the right directory vnode for the filesystem root. After this change vfs_busy keeps the same behavior for no flags and LK_NOWAIT. But if some other flags are passed into it, they are passed directly into lockmgr (actually LK_SLEEPFAIL is always added to those flags because if we sleep for the lock, that means someone was holding the exclusive lock and the exclusive lock is only held when the filesystem is being unmounted. More changes: dounmount must now be called with the exclusive lock held. (before this the caller was supposed to hold the vfs_busy lock, but that wasn't always true). Zap some (now) unused mount flags. And the highlight of this change: Add some vfs_busy calls to match some vfs_unbusy calls, especially in sys_mount. (lockmgr doesn't detect the case where we release a lock noone holds (it will do that soon)). If you've seen hangs on reboot with mfs this should solve it (I repeat this for the fourth time now, but this time I spent two months fixing and redesigning this and reading the code so this time I must have gotten this right).
2002-03-14First round of __P removal in sysTodd C. Miller
2002-02-22Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@Dale Rahn
2002-02-12More FREF/FRELE protection. This time all users of getvnode.Artur Grabowski
2002-02-08Require a FREFd file in dofilewrite{,v}.Artur Grabowski
2002-02-08require a FREFd fp in dofilereadv. Fix some comments.Artur Grabowski
2002-02-08simplify sys_pread a bit.Artur Grabowski
2002-02-08- Rename FILE_{,UN}USE to FREF and FRELE. USE is a bad verb and we don't haveArtur Grabowski
the same semantics as NetBSD anyway, so it's good to avoid name collissions. - Always fdremove before freeing the file, not the other way around. - falloc FREFs the file. - have FILE_SET_MATURE FRELE the file (It feels like a good ortogonality to falloc FREFing the file). - Use closef as much as possible instead of ffree in error paths of falloc:ing functions. closef is much more careful with the fd and can deal with the fd being forcibly closed by dup2. Also try to avoid manually calling *fo_close when closef can do that for us (this makes some error paths mroe complicated (sys_socketpair and sys_pipe), but others become simpler (sys_open)).
2002-02-05Add counting of temporary references to a struct file (as opposed to referencesArtur Grabowski
from fd tables and other long-lived objects). This is to avoid races between using a file descriptor and having another process (with shared fd table) close it. We use a separate refence count so that error values from close(2) will be correctly returned to the caller of close(2). The macros for those reference counts are FILE_USE(fp) and FILE_UNUSE(fp). Make sure that the cases where closef can be called "incorrectly" (most notably dup2(2)) are handled. Right now only callers of closef (and {,p}read) use FILE_{,UN}USE correctly, more fixes incoming soon.