summaryrefslogtreecommitdiffstats
path: root/sys/tmpfs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Refactor klist insertion and removalvisa2020-12-251-3/+3
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Fix build of tmpfsvisa2020-10-122-2/+5
| | | | | | | The breakage was caused by the removal of #include <sys/systm.h> from <uvm/uvm_map.h>. OK deraadt@, mpi@, beck@
* tmpfs_reclaim() has to make sure the VFS cache has no more locks heldgerhard2020-07-151-1/+3
| | | | | | for the vnode. ok beck@
* Rename poll-compatibility flag to better reflect what it is.mpi2020-06-111-2/+2
| | | | | | While here prefix kernel-only EV flags with two underbars. Suggested by kettenis@, ok visa@
* Use a new EV_OLDAPI flag to match the behavior of poll(2) and select(2).mpi2020-06-081-1/+4
| | | | | | | | | Adapt FS kqfilters to always return true when the flag is set and bypass the polling mechanism of the NFS thread. While here implement a write filter for NFS. ok visa@
* Abstract the head of knote lists. This allows extending the lists,visa2020-04-071-3/+3
| | | | | | for example, with locking assertions. OK mpi@, anton@
* Replace field f_isfd with field f_flags in struct filterops to allowvisa2020-02-201-4/+4
| | | | | | adding more filter properties without cluttering the struct. OK mpi@, anton@
* struct vops is not modified during runtime so use const which moves eachclaudio2020-01-204-8/+8
| | | | | into read-only data segment. OK deraadt@ tedu@
* Use C99 designated initializers with struct filterops. In addition,visa2019-12-311-7/+21
| | | | | | make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
* Convert struct vfsops initializer to C99 style.bluhm2019-12-261-15/+15
| | | | OK visa@
* Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX.millert2019-10-171-2/+1
| | | | | This is clearer and more consistent with the rest of the kernel. OK deraadt@ sashan@
* Allow concurrent reads of the f_offset field of struct file byanton2019-08-051-2/+2
| | | | | | | | | serializing both read/write operations using the existing file mutex. The vnode lock still grants exclusive write access to the offset; the mutex is only used to make the actual write atomic and prevent any concurrent reader from observing intermediate values. ok mpi@ visa@
* Revert anton@ changes about read/write unlockingsolene2019-07-121-2/+2
| | | | | | https://marc.info/?l=openbsd-cvs&m=156277704122293&w=2 ok anton@
* Make read/write of the f_offset field belonging to struct file MP-safe;anton2019-07-101-2/+2
| | | | | | | | | | | | | | | | as part of the effort to unlock the kernel. Instead of relying on the vnode lock, introduce a dedicated lock per file. Exclusive write access is granted using the new foffset_enter and foffset_leave API. A convenience function foffset_get is also available for threads that only need to read the current offset. The lock acquisition order in vn_write has been changed to match the one in vn_read in order to avoid a potential deadlock. This change also gets rid of a documented race in vn_read(). Inspired by the FreeBSD implementation. With help and ok mpi@ visa@
* Introduce a dedicated entry point data structure for file locks. This new dataanton2019-01-211-2/+2
| | | | | | | | | | | | structure allows for better tracking of pending lock operations which is essential in order to prevent a use-after-free once the underlying vnode is gone. Inspired by the lockf implementation in FreeBSD. ok visa@ Reported-by: syzbot+d5540a236382f50f1dac@syzkaller.appspotmail.com
* More "explicitely" -> "explicitly" in various comments.krw2018-10-221-2/+2
| | | | ok guenther@ tb@ deraadt@
* Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible forvisa2018-06-071-14/+6
| | | | | | unlocking the directory vnode. OK mpi@, helg@
* Call vput(dvp) in vnode operation functions instead of calling it invisa2018-05-282-5/+12
| | | | | | | the file allocation routine. This allows stepwise changing of the vnode locking discipline. OK mpi@
* Drop unnecessary `p' parameter from vget(9).visa2018-05-271-2/+2
| | | | OK mpi@
* Fix build without DIAGNOSTIC, ok mikeb@reyk2018-05-231-2/+5
|
* Remove proc from the parameters of vn_lock(). The parameter isvisa2018-05-022-6/+6
| | | | | | unnecessary because curproc always does the locking. OK mpi@
* Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is alwaysvisa2018-04-281-14/+14
| | | | | | | curproc that does the locking or unlocking, so the proc parameter is pointless and can be dropped. OK mpi@, deraadt@
* Now that the args are passed in by the caller there is no need to callpatrick2018-04-061-4/+1
| | | | | | copyin(9) ourselves anymore. Fixes tmpfs after recent changes. ok bluhm@ deraadt@ visa@
* Use RWL_IS_VNODE with locks that are acquired through VOP_LOCK(),visa2018-03-281-2/+2
| | | | | | | | to appease WITNESS. ext2fs and ffs already use the flag. The same locking pattern appears with other file systems too, so this patch addresses the remaining cases. OK mpi@
* add "int stall" argument required by filesystem stall code; from Tomohiro Kusumideraadt2018-03-071-3/+4
|
* In uvm Chuck decided backing store would not be allocated proactivelyderaadt2017-12-111-12/+12
| | | | | | | | | | | | | | | | | | | | | | for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* Tweak lock inits to make the system runnable with witness(4)visa2017-04-201-2/+2
| | | | on amd64 and i386.
* Fix indentation. No binary change.jsg2016-09-221-5/+5
|
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-7/+5
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* pool_setipl for tmpfs.dlg2016-08-231-1/+3
|
* Set the vfs_systcl member of the vsfops struct to eopnotsupp. While we checkkettenis2016-07-221-2/+2
| | | | | | for a null pointer now, all other filesystems fill in the complete table. ok deraadt@, tom@
* don't allow mounting with noval owner. panics later.tedu2016-07-111-1/+4
| | | | | reported by Tim Newsham at NCC. ok millert natano
* Remove the lockmgr() API. It is only used by filesystems, where it is anatano2016-06-193-8/+9
| | | | | | | | trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. tested by naddy and sthen on package building infrastructure input and ok jmc mpi tedu
* Fix some issues wrt timestamp updating. The tmpfs_read() andnatano2016-05-021-5/+10
| | | | | | | | tmpfs_readlink() functions ignore the noatime mount option, tmpfs_read() should not update atime when zero bytes have been requested (as per posix) and tmpfs_write() should update mtime and ctime (as per posix). ok espie
* Remove the unused flags argument from VOP_UNLOCK().natano2016-03-191-15/+15
| | | | | | torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
* Convert to uiomove. From Martin Natano.stefan2016-02-062-8/+8
|
* kill malloc(9) pointless check, malloc(9) call is using M_WAITOK flag and thus will sleep untilgsoares2016-01-131-3/+1
| | | | | | get memory available so shouln't fail. OK deraadt@ mmcc@
* fix nde structure initialization, noticed in netbsd pr 50381 by mmcc@beck2015-12-111-2/+2
| | | | | by ensuring the structure is zeroed when allocated from the pool ok mmcc@, stsp@
* correct errant spacingtedu2015-12-081-8/+8
|
* Tweaks utimensat/futimens handling to always update ctime, even when bothguenther2015-04-172-10/+14
| | | | | | | atime and mtime are UTIME_OMIT (at least for ufs, tmpfs, and ext2fs), and to correctly handle a timestamp of -1. ok millert@
* Remove some includes include-what-you-use claims don'tjsg2015-03-142-4/+2
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* First step towards making uiomove() take a size_t size argument:miod2015-02-102-7/+7
| | | | | | | - rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
* remove #if 0 cdefs.h blocksderaadt2015-01-216-36/+6
|
* change pool allocator to null and pass waitok to indicate nointrtedu2014-12-231-5/+5
|
* remove lock.h from uvm_extern.h. another holdover from the simpletonlocktedu2014-12-171-1/+2
| | | | | era. fix uvm including c files to include lock.h or atomic.h as necessary. ok deraadt
* Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latterguenther2014-12-171-4/+4
| | | | | | doesn't have all the values and therefore can't be used everywhere. ok deraadt@ kettenis@
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+3
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,guenther2014-12-151-3/+3
| | | | | | eliminating the must-be-kept-in-sync UVM_INH_* macros ok deraadt@ tedu@
* Disallow file allocations on directories that have been removeddcoppa2014-12-041-1/+6
| | | | | | | | | | | (tn_links == 0). Failure to enforce such a check can lead to the violation of the assumption that removed directories should not contain directory entries and thus trigger a kernel diagnostic assertion (panic). Fix provided by Pedro Martelletto, thanks! OK millert@