summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_vops.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Document that `a_p' is always curproc by using a KASSERT().mpi2020-10-071-1/+12
| | | | | | | | | | | | One exception of this rule is VOP_CLOSE() where NULL is used instead of curproc when the garbace collector of unix sockets, that runs in a kernel thread, drops the last reference of a file. This will allows for future simplifications of the VFS interfaces. Previous version ok visa@, anton@. ok kn@
* Make fifo_kqfilter() honor FREAD|FWRITE just like fifo_poll() does.mpi2020-04-081-2/+3
| | | | | | | Prevent generating events that do not correspond to how the fifo has been opened. ok visa@, millert@
* Revert previous, syzkaller found a way to trigger the KASSERT().mpi2020-03-311-12/+1
| | | | Let's fix this before we put them back :o)
* Document that `a_p' is always curproc by using a KASSERT().mpi2020-03-301-1/+12
| | | | | | | | This will allows for future simplifications of the VFS interfaces. Tested in a bulk by naddy@ and visa@. ok visa@, anton@
* The v_inflight counter was added to mark vnodes that currently do an operationclaudio2020-02-141-6/+2
| | | | | | | | | | that modifies the filesystem as inflight. This is used in the sync calls (on suspend and hibernate) to mark filesystems clean if no work is in flight. VOP_UNLOCK() also got the v_inflight dance but VOP_UNLOCK does not alter filesystem space and so it does not matter if VOP_UNLOCK() is currently run. Also VOP_UNLOCK() does not sleep so there is no way for the sync code to see an inflight VOP_UNLOCK(). OK visa@
* Move the LK_DRAIN logic from VOP_LOCK() to vclean() the only caller ofclaudio2020-02-131-13/+1
| | | | | VOP_LOCK with LK_DRAIN. This simplifies VOP_LOCK() a fair bit. OK visa@
* Convert infinite sleeps to tsleep_nsec(9).mpi2019-12-081-2/+2
| | | | ok visa@, jca@
* When a thread tries to exclusively lock a vnode, the same thread mustanton2019-08-261-1/+13
| | | | | | | | | | | | ensure that any other thread currently trying to acquire the underlying vnode lock has observed that the same vnode is about to be exclusively locked. Such threads must then sleep until the exclusive lock has been released and then try to acquire the lock again. Otherwise, exclusive access to the vnode cannot be guaranteed. Thanks to naddy@ and visa@ for testing; ok visa@ Reported-by: syzbot+374d0e7e2400004957f7@syzkaller.appspotmail.com
* Make VOP_ADVLOCK() safe to use without kernel lockvisa2019-05-031-6/+2
| | | | | | | | | | | All non-dummy implementations of VOP_ADVLOCK() rely on lf_advlock() which is now safe to use without the kernel lock. Because VOP_ADVLOCK() does not make the vnode dirty, it is unnecessary to keep track of in-flight vnode lock operations and the updating of vnode->v_inflight can be dropped from VOP_ADVLOCK(). This makes VOP_ADVLOCK() safe to use without the kernel lock. OK tedu@ mpi@
* if a write fails, we mark the buffer invalid and throw it away. this cantedu2019-02-171-2/+6
| | | | | | | lead to lost errors, where a later fsync will return success. to fix this, set a flag on the vnode indicating a past error has occurred, and return an error for future fsync calls. ok bluhm deraadt visa
* Drop redundant "node == parent node" checks from VOP_RMDIR()visa2018-06-211-1/+3
| | | | | | implementations. Rely on the VFS layer to do the checking. OK mpi@, helg@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-5/+3
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Syncronize filesystems to disk when suspending. Each mountpoint's vnodesderaadt2018-02-101-23/+112
| | | | | | | | | | are pushed to disk. Dangling vnodes (unlinked files still in use) and vnodes undergoing change by long-running syscalls are identified -- and such filesystems are marked dirty on-disk while we are suspended (in case power is lost, a fsck will be required). Filesystems without dangling or busy vnodes are marked clean, resulting in faster boots following "battery died" circumstances. Tested by numerous developers, thanks for the feedback.
* VOP_REALLOCBLKS() and related code is unused since the removal ofnatano2016-05-231-16/+1
| | | | | cluster_write(). ok beck zhuk
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-3/+2
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Use two 2q caches for the buffer cache, moving previously warm buffers from thebeck2015-07-191-1/+5
| | | | | | | first queue to the second. Mark the first queue as DMA in preparation for being able to use more memory by flipping. Flipper code currently only sets and clears the flag. ok tedu@ guenther@
* Pass fflag to VOP_POLL so vfs fifo functions can get at the filemillert2015-05-011-2/+3
| | | | | | flags to check FREAD/FWRITE if needed. This will be used by fifo_poll to avoid checking the write end of the fifo when the fd is read-only. OK guenther@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Oops, missed the new #include when manually applying the diff fromguenther2015-01-191-1/+3
| | | | Helg (xx404 (at) msn.com)
* Fix bracing in ASSERT_VP_ISLOCKED(vp) macro to not always panic()guenther2015-01-191-5/+6
| | | | From Helg (xx404 (at) msn.com)
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-4/+2
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* back out the cache flipper temporarily to work out of tree.beck2013-07-091-6/+1
| | | | | will come back soon. ok deraadt@
* High memory page flipping for the buffer cache.beck2013-06-111-1/+6
| | | | | | | | | | | | | | This change splits the buffer cache free lists into lists of dma reachable buffers and high memory buffers based on the ranges returned by pmemrange. Buffers move from dma to high memory as they age, but are flipped to dma reachable memory if IO is needed to/from and high mem buffer. The total amount of buffers allocated is now bufcachepercent of both the dma and the high memory region. This change allows the use of large buffer caches on amd64 using more than 4 GB of memory ok tedu@ krw@ - testing by many.
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-111-3/+3
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* Handle the pathconf _PC_PATH_MAX, _PC_PIPE_BUF, _PC_ASYNC_IO,guenther2013-03-281-1/+21
| | | | | | | | | | | _PC_PRIO_IO, and _PC_SYNC_IO names in VOP_PATHCONF(), as they're fs-independent for us. Since we don't support latter three on any fs, we can also define the related _POSIX_{ASYNC,PRIO,SYNC}_IO symbols in <unistd.h> (via sys/unistd.h) with value -1. Also, zap pointless tty-only values from procfs(!). ok beck@, deraadt@
* rename VFSDEBUG to VFLCKDEBUG;thib2011-07-021-2/+2
| | | | prompted by tedu@
* Every single vop_default is set to eopnotsupp, so retire itthib2011-04-051-38/+72
| | | | | | | | and return EOPNOTSUPP directly from the VOP_* functions. Filesystems should, at some point fill in every function in the vop_default struct so we can get rid of the 'if' statements in VOP_*.
* Add $OpenBSD$ prompted by mikeb@thib2010-09-081-0/+1
|
* End the VOP experiment. Instead of the ridicolusly complicated operationthib2010-09-061-0/+595
vector setup that has questionable features (that have, as far as I can tell never been used in practice, atleast not in OpenBSD), remove all the gunk and favor a simple struct full of function pointers that get set directly by each of the filesystems. Removes gobs of ugly code and makes things simpler by a magnitude. The only downside of this is that we loose the vnoperate feature so the spec/fifo operations of the filesystems need to be kept in sync with specfs and fifofs, this is no big deal as the API it self is pretty static. Many thanks to armani@ who pulled an earlier version of this diff to current after c2k10 and Gabriel Kihlman on tech@ for testing. Liked by many. "come on, find your balls" deraadt@.