summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
AgeCommit message (Collapse)Author
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.
2002-02-04Don't ffree the newly allocated file before calling dupfdopen.Artur Grabowski
In some cases that could cause dupfdopen->fd_getfile to access freed memory setting fd_ofiles[fd] to NULL is not a solution because that would cause a race condition. Free the new file after dupfdopen and use closef (because it will be necessary in the future. XXX - consider more cleanup of the code around dupfdopen.
2002-01-21Mount points must fit in MNAMELEN, not MAXPATHLEN so use copyinstr()Todd C. Miller
to detect whether the path passed in from userland is too long. Based on a patch from peterw AT ifost.org.au.
2002-01-18record ctime for the mountpoint, mount time or last mount update; art@ okMichael Shalayeff
2001-12-19UBC was a disaster. It worked very good when it worked, but on someArtur Grabowski
machines or some configurations or in some phase of the moon (we actually don't know when or why) files disappeared. Since we've not been able to track down the problem in two weeks intense debugging and we need -current to be stable, back out everything to a state it had before UBC. We apologise for the inconvenience.
2001-11-27Merge in the unified buffer cache code as found in NetBSD 2001/03/10. TheArtur Grabowski
code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>. Tested for the past few weeks by many developers, should be in a pretty stable state, but will require optimizations and additional cleanups.
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-10-26 - every new fd created by falloc() is marked as larval and should not be usedArtur Grabowski
any anyone. Every caller of falloc matures the fd when it's usable. - Since every lookup in the fd table must now check this flag and all of them do the same thing, move all the necessary checks into a function - fd_getfile.
2001-07-26Back out changes to symlink and mknod that were not well tested.Todd C. Miller
A simple mknod at causes a kernel panic (uvm_fault).
2001-07-26change vop_symlink and vop_mknod to return vpp (the created node)assar
refed, so that the caller can actually use it. update callers and file systems that implement these vnode operations ok'd by art
2001-06-27remove old vmArtur Grabowski
2001-06-22KNFTheo de Raadt
2001-05-23Indentation.Artur Grabowski
2001-05-16Create COMPAT_25 and move ogetfsstat, ostatfs and ostatfs into it.Todd C. Miller
Create COMPAT_23 and move __osemctl, omsgctl, oshmctl there.
2001-05-16kill COMPAT_{09,10,11} kernel options. We still need kern_info_09.c and ↵Todd C. Miller
kern_ipc_10.c for other compat modules.
2001-05-14Isn't copy 'n paste a great invention?Artur Grabowski
2001-05-14Remove some unnecessary code + some random cleanup.Artur Grabowski
2001-05-13Add pad argument for p{read,write}v? to the syscall args comment forTodd C. Miller
consistency with syscallargs.h as well as sys_lseek.
2001-04-04Add "softdep" option to mount. Update from rw/async to softdepGrigoriy Orlov
and otherwise are disabled. art@ ok.
2001-03-16Use CIRCLEQ macros for mountlist.Artur Grabowski
2001-02-21Latest soft updates from FreeBSD/Kirk McKusickConstantine Sapuntzakis
Snapshot-related code has been commented out.
2001-02-20use void * consistently in vfs_mount and sys_mount. ok @artassar
2001-02-12Check if softdep is enabled for this fs before calling softdep'sFederico G. Schwindt
fsync; art@ ok.
2000-04-20p{read,write}{,v} from csapuntz, partial NetBSD origin I thinkTheo de Raadt
2000-04-15Fix sys_sync to actually sync all file systems.Constantine Sapuntzakis
2000-03-03Use LIST_ macros instead of internal field names to walk the allproc list.Artur Grabowski
2000-02-07(sys_getfh): moved here from nfs_syscalls.cassar
(sys_fhopen, sys_fhstat, sys_fhstatfs): new system calls that use file handles instead of file names. largely based on NetBSD
2000-02-01remove superflous declaration of vnops, it's now in <sys/file.h>assar
1999-12-06Yet another solution to the mfs unmount/kill race (not ugly this time).Artur Grabowski
Require that the mount point is vfs_busy on entry to dounmount.
1999-07-30do not permit regular users to chflags/fchflags on chr or blk devices --Theo de Raadt
even if they happen to own them at the moment.
1999-07-13introduce fdremove() to mark a file descriptor as unused. fdremove makesNiels Provos
sure that the fd_freefile hints stay in sync, otherwise free file descriptors might not be overlooked by fdalloc(); ok millert@
1999-05-31New struct statfs with mount options. NOTE: this replaces statfs(2),Todd C. Miller
fstatfs(2), and getfsstat(2) so you will need to build a new kernel before doing a "make build" or you will get "unimplemented syscall" errors. The new struct statfs has the following featuires: o Has a u_int32_t flags field--now softdep can have a real flag. o Uses u_int32_t instead of longs (nicer on the alpha). Note: the man page used to lie about setting invalid/unused fields to -1. SunOS does that but our code never has. o Gets rid of f_type completely. It hasn't been used since NetBSD 0.9 and having it there but always 0 is confusing. It is conceivable that this may cause some old code to not compile but that is better than silently breaking. o Adds a mount_info union that contains the FSTYPE_args struct. This means that "mount" can now tell you all the options a filesystem was mounted with. This is especially nice for NFS. Other changes: o The linux statfs emulation didn't convert between BSD fs names and linux f_type numbers. Now it does, since the BSD f_type number is useless to linux apps (and has been removed anyway) o FreeBSD's struct statfs is different from our (both old and new) and thus needs conversion. Previously, the OpenBSD syscalls were used without any real translation. o mount(8) will now show extra info when invoked with no arguments. However, to see *everything* you need to use the -v (verbose) flag.
1999-02-26adaptation to uvm vnode pagerArtur Grabowski
1999-02-15reorder some flag handling in unmount for safer lockingArtur Grabowski
1999-02-15Fail correctly when trying to match a filesystem on the old typenumArtur Grabowski
and the typenum is out of range
1999-01-19Single Unix specification 2 says that rmdir(".") should suceed or give EBUSYArtur Grabowski
1999-01-10remove unnecessary declaration of dounmountArtur Grabowski
1998-12-28remove old leftovers from lite2 upgradeArtur Grabowski
1998-12-23Opps. the flag that says that we are sleeping is MNT_MWAIT, not MNT_WAITArtur Grabowski
1998-12-21return EOPNOTSUPP when there is no support for this filesystem in the kernel.Artur Grabowski
This is what most mount_* expect.
1998-12-10Several fixes to dounmount.Artur Grabowski
- Check for MNT_UNMOUNT before doing the actual unmount. It shouldn't matter for normal unmounts that go through sys_unmount, because they won't be able to do a lookup on the mountpoint when it's being unmounted, but mfs calls dounmount directly (and there was still a race). - clear the MNT_UNMOUNT flag after reenabling the lock (almost impossible race). - clear the MNT_MWAIT flag after doing a wakeup on the mountpoint.
1998-11-12Integrate latest soft updates patches for McKusick.Constantine Sapuntzakis
Integrate cleaner ffs mount code from FreeBSD. Most notably, this mount code prevents you from mounting an unclean file system read-write.
1998-09-27Only update vfs_refcount when the mount succeeds and MNT_UPDATE not set.Todd C. Miller