History log of /openbsd/sys/tmpfs/tmpfs_vnops.c (Results 1 – 25 of 55)
Revision Date Author Comments
# aa47c49a 13-May-2024 semarie <semarie@openbsd.org>

vfs: VOP_REMOVE: move vnode unlocking and ref dropping to FS-indep part

while here, ensure all vop_remove field are set, and always call the function.

the change is very conservative: it only adds

vfs: VOP_REMOVE: move vnode unlocking and ref dropping to FS-indep part

while here, ensure all vop_remove field are set, and always call the function.

the change is very conservative: it only adds vnode ref drop/unlock where it was
absent because it should be unreachable (and if it wasn't, it should fix
things).

ok miod@

show more ...


# 6cb92a3c 25-Mar-2024 guenther <guenther@openbsd.org>

Move the "no (hard) linking directories" and "no cross-mount links"
checks from all the filesystems that support hardlinks at all into
the VFS layer. Simplify, EPERM description in link(2).

ok miod

Move the "no (hard) linking directories" and "no cross-mount links"
checks from all the filesystems that support hardlinks at all into
the VFS layer. Simplify, EPERM description in link(2).

ok miod@ mpi@

show more ...


# cc53a24c 08-Sep-2023 mvs <mvs@openbsd.org>

Remove the remnants of the leftover selinfo from vnode(9) layer. Just
mechanical 'selinfo' to 'klist' replacement in 'vnode' structure because
knote(9) API is already used.

<sys/selinfo.h> headers a

Remove the remnants of the leftover selinfo from vnode(9) layer. Just
mechanical 'selinfo' to 'klist' replacement in 'vnode' structure because
knote(9) API is already used.

<sys/selinfo.h> headers added where is was required.

ok bluhm

show more ...


# 5c9fbd3c 26-Jun-2022 visa <visa@openbsd.org>

Remove unused VOP_POLL().

OK mpi@


# 6ecc0d7f 11-Dec-2021 visa <visa@openbsd.org>

Clarify usage of __EV_POLL and __EV_SELECT

Make __EV_POLL specific to kqueue-based poll(2), to remove overlap
with __EV_SELECT that only select(2) uses.

OK millert@ mpi@


# 0f6f508b 24-Oct-2021 patrick <patrick@openbsd.org>

tiny little whitespace fixes


# 7cab0185 24-Oct-2021 patrick <patrick@openbsd.org>

Prohibit renames of tmpfs mount-points to fix a panic.

From gerhard@


# 9720dc33 23-Oct-2021 patrick <patrick@openbsd.org>

Call uvm_vnp_uncache() in tmpfs_write(). We currently only call
uvm_vnp_uncache() in tmpfs_write() when a file grows in size. This
is not enough. We need to invalidate UVM's cache of the vnode eve

Call uvm_vnp_uncache() in tmpfs_write(). We currently only call
uvm_vnp_uncache() in tmpfs_write() when a file grows in size. This
is not enough. We need to invalidate UVM's cache of the vnode every
time the contents of the vnode are modified. Failure to do so might
lead to inconsistencies between read/mmap consumers.

From Pedro Martelletto

show more ...


# ba6398e8 23-Oct-2021 patrick <patrick@openbsd.org>

Fix tmpfs_lookup locking for ".." == ".". unveil_find_cover() calls
VFS_LOOKUP(dir, &parent) in a loop and looks up the parent directory
".." repeatedly. VFS_LOOKUP is expected to unlock 'dir' and r

Fix tmpfs_lookup locking for ".." == ".". unveil_find_cover() calls
VFS_LOOKUP(dir, &parent) in a loop and looks up the parent directory
".." repeatedly. VFS_LOOKUP is expected to unlock 'dir' and return
'parent' locked.

So tmpfs_lookup() is called for ISDOTDOT and:
- runs with dvp = dir, vpp = &parent
- gets parent from tmpfs_vnode_get() and
- re-locks dir with vn_lock(dvp)
but skips the call to
VOP_UNLOCK(dvp);
on return because *vpp == dvp

The reason for doing so is the lookup for ".". In this case
tmpfs_lookup() just increases the reference on dvp and copies the
pointer:
*vpp = dvp; vref(dvp);

However, in our case we also have *vpp == dvp, but for a different
lookup (ISDOTDOT), so we must do the unlock.

From markus@

show more ...


# b66b9ef8 11-Mar-2021 jsg <jsg@openbsd.org>

spelling


# 9b0cf67b 25-Dec-2020 visa <visa@openbsd.org>

Refactor klist insertion and removal

Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remai

Refactor klist insertion and removal

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@

show more ...


# 99ef5f49 12-Oct-2020 visa <visa@openbsd.org>

Fix build of tmpfs

The breakage was caused by the removal of #include <sys/systm.h>
from <uvm/uvm_map.h>.

OK deraadt@, mpi@, beck@


# 78b494b9 15-Jul-2020 gerhard <gerhard@openbsd.org>

tmpfs_reclaim() has to make sure the VFS cache has no more locks held
for the vnode.

ok beck@


# 1c57bd6b 11-Jun-2020 mpi <mpi@openbsd.org>

Rename poll-compatibility flag to better reflect what it is.

While here prefix kernel-only EV flags with two underbars.

Suggested by kettenis@, ok visa@


# 6e29a944 08-Jun-2020 mpi <mpi@openbsd.org>

Use a new EV_OLDAPI flag to match the behavior of poll(2) and select(2).

Adapt FS kqfilters to always return true when the flag is set and bypass
the polling mechanism of the NFS thread.

While here

Use a new EV_OLDAPI flag to match the behavior of poll(2) and select(2).

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@

show more ...


# 9c969c9a 07-Apr-2020 visa <visa@openbsd.org>

Abstract the head of knote lists. This allows extending the lists,
for example, with locking assertions.

OK mpi@, anton@


# b8213689 20-Feb-2020 visa <visa@openbsd.org>

Replace field f_isfd with field f_flags in struct filterops to allow
adding more filter properties without cluttering the struct.

OK mpi@, anton@


# 2d6b9e38 20-Jan-2020 claudio <claudio@openbsd.org>

struct vops is not modified during runtime so use const which moves each
into read-only data segment.
OK deraadt@ tedu@


# 94321eb4 31-Dec-2019 visa <visa@openbsd.org>

Use C99 designated initializers with struct filterops. In addition,
make the structs const so that the data are put in .rodata.

OK mpi@, deraadt@, anton@, bluhm@


# 836f297b 05-Aug-2019 anton <anton@openbsd.org>

Allow concurrent reads of the f_offset field of struct file by
serializing both read/write operations using the existing file mutex.
The vnode lock still grants exclusive write access to the offset;

Allow concurrent reads of the f_offset field of struct file by
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@

show more ...


# 6784024e 12-Jul-2019 solene <solene@openbsd.org>

Revert anton@ changes about read/write unlocking
https://marc.info/?l=openbsd-cvs&m=156277704122293&w=2

ok anton@


# d038d3d5 10-Jul-2019 anton <anton@openbsd.org>

Make read/write of the f_offset field belonging to struct file MP-safe;
as part of the effort to unlock the kernel. Instead of relying on the
vnode lock, introduce a dedicated lock per file. Exclusiv

Make read/write of the f_offset field belonging to struct file MP-safe;
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@

show more ...


# c43131ad 22-Oct-2018 krw <krw@openbsd.org>

More "explicitely" -> "explicitly" in various comments.

ok guenther@ tb@ deraadt@


# 4dd4d774 07-Jun-2018 visa <visa@openbsd.org>

Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible for
unlocking the directory vnode.

OK mpi@, helg@


# 9d1c6d70 28-May-2018 visa <visa@openbsd.org>

Call vput(dvp) in vnode operation functions instead of calling it in
the file allocation routine. This allows stepwise changing of the vnode
locking discipline.

OK mpi@


123