History log of /src/sys/fs/tmpfs/tmpfs_vnops.c (Results 1 – 25 of 857)
Revision Date Author Comments
# 7aaec5f3 26-Feb-2026 Konstantin Belousov <kib@FreeBSD.org>

renameat2(2): implement AT_RENAME_NOREPLACE flag

For msdosfs, tmpfs, and ufs.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https:/

renameat2(2): implement AT_RENAME_NOREPLACE flag

For msdosfs, tmpfs, and ufs.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55539

show more ...


# e486066c 26-Feb-2026 Konstantin Belousov <kib@FreeBSD.org>

VOP_RENAME(9): add flags argument

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55539


# 30ae88e3 16-Dec-2025 Konstantin Belousov <kib@FreeBSD.org>

swap_pager_seek_data(): move the clipping at the object size to consumers

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebs

swap_pager_seek_data(): move the clipping at the object size to consumers

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54219

show more ...


# 7e4c451c 27-Sep-2025 Mateusz Guzik <mjg@FreeBSD.org>

vfs: retire the VREF macro

It is defined as a plain use of vref.

Churn generated with coccinelle:
@@
expression vp;
@@

- VREF(vp)
+ vref(vp)


# 01c8e2e3 27-Sep-2025 Mateusz Guzik <mjg@FreeBSD.org>

vfs: retire the NULLVP macro

The kernel was already mostly using plain NULL, just whack it and be
doen with the legacy.

Churn generated with coccinelle:
@@
@@

- NULLVP
+ NULL


# 567e6250 17-Aug-2025 Dag-Erling Smørgrav <des@FreeBSD.org>

vfs: Introduce VN_ISDEV() macro

We frequently need to check if a vnode refers to either a character or
block special, so we might as well have a macro for it.

We somewhat less frequently need to pe

vfs: Introduce VN_ISDEV() macro

We frequently need to check if a vnode refers to either a character or
block special, so we might as well have a macro for it.

We somewhat less frequently need to perform similar checks on things
that aren't vnodes (usually a struct vattr *), so add VATTR_ISDEV()
and a generic VTYPE_ISDEV() as well.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D51947

show more ...


# 4b56c7ff 24-Jul-2025 Mark Johnston <markj@FreeBSD.org>

tmpfs: Remove uses of DEBUG_VFS_LOCKS

This assertion can reasonably be checked when plain INVARIANTS is
configured, there's no need to configure a separate option.

Reviewed by: kib
MFC after: 2 wee

tmpfs: Remove uses of DEBUG_VFS_LOCKS

This assertion can reasonably be checked when plain INVARIANTS is
configured, there's no need to configure a separate option.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D51697

show more ...


# afd5bc63 05-Jul-2025 Rick Macklem <rmacklem@FreeBSD.org>

pathconf: Add a new variable for hidden/system

For the NFSv4 server to implement the "hidden" and
"system" attributes, it needs to know if UF_HIDDEN,
UF_SYSTEM are supported for the file.

This patc

pathconf: Add a new variable for hidden/system

For the NFSv4 server to implement the "hidden" and
"system" attributes, it needs to know if UF_HIDDEN,
UF_SYSTEM are supported for the file.

This patch adds a new pathconf variable called
_PC_HAS_HIDDENSYSTEM to do that. The ZFS patch
will be handled separately as a OpenZFS pull request.

Although this pathconf variable may be queried
by applications using pathconf(2), the current
interface where chflags(2) returns EOPNOTSUPP
may still be used to check if the flags are set.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D51172

show more ...


# b4663a8d 13-Jan-2025 Konstantin Belousov <kib@FreeBSD.org>

stat(2): add st_filerev

Reviewed by: asomers, markj, olce, rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D48452


# 1ccbdf56 06-Dec-2024 Olivier Certner <olce@FreeBSD.org>

tmpfs: Rework file handles

Change 'struct tmpfs_fid_data' to behave consistently with the private
structure other FSes use. In a nutshell, make it a full alias of
'struct fid', instead of just usin

tmpfs: Rework file handles

Change 'struct tmpfs_fid_data' to behave consistently with the private
structure other FSes use. In a nutshell, make it a full alias of
'struct fid', instead of just using it to fill 'fid_data'. This implies
adding a length field at start (aliasing 'fid_len' of 'struct fid'), and
filling 'fid_len' with the full size of the aliased structure.

To ensure that the new 'struct tmpfs_fid_data' is smaller than 'struct
fid', which the compile-time assert introduced in commit
91b5592a1e1af974 ("fs: Add static asserts for the size of fid
structures") checks (and thus was not strong enough when added), use
'__packed'.

A consequence of this change is that copying the 'struct tmpfs_fid_data'
into a stack-allocated variable becomes unnecessary, we simply rely on
the compiler emitting the proper code on seeing '__packed' (and on the
start of 'struct tmpfs_fid_data' being naturally aligned, which is
normally guaranteed by kernel's malloc() and/or inclusion in 'struct
fhandle').

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47956

show more ...


# 91b5592a 06-Dec-2024 Rick Macklem <rmacklem@FreeBSD.org>

fs: Add static asserts for the size of fid structures

File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct f

fs: Add static asserts for the size of fid structures

File system specific *fid structures are copied into the generic
struct fid defined in sys/mount.h.
As such, they cannot be larger than struct fid.

This patch adds _Static_assert()s to check for this.

ZFS and fuse already have _Static_assert()s.

Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47936

show more ...


# db08b0b0 24-Oct-2024 Doug Moore <dougm@FreeBSD.org>

tmpfs_vnops: move swap work to swap_pager

Two functions in tmpfs_vnops.c use an interface provided by
swap_pager.c. Move most of the implementation of those functions to
swap_pager.c so that they ca

tmpfs_vnops: move swap work to swap_pager

Two functions in tmpfs_vnops.c use an interface provided by
swap_pager.c. Move most of the implementation of those functions to
swap_pager.c so that they can be implemented more effectively, with
access to implementation details of the swap pager.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D47212

show more ...


# ec22e705 13-Oct-2024 Claudiu <mscotty@protonmail.ch>

tmpfs: remove duplicate flags check in tmpfs_rmdir

MFC after: 2 weeks
Reviewed By: asomers
Differential Revision: https://reviews.freebsd.org/D47100


# 75734c43 04-Oct-2024 Doug Moore <dougm@FreeBSD.org>

tmpfs: check residence in data_locked

tmpfs_seek_data_locked should return the offset of the first page
either resident in memory or in swap, but may return an offset to a
nonresident page. Check fo

tmpfs: check residence in data_locked

tmpfs_seek_data_locked should return the offset of the first page
either resident in memory or in swap, but may return an offset to a
nonresident page. Check for residence to fix that.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D46879

show more ...


# 8fa5e0f2 06-Aug-2024 Jason A. Harmening <jah@FreeBSD.org>

tmpfs: Account for whiteouts during rename/rmdir

The existing tmpfs implementation will return ENOTEMPTY for VOP_RMDIR,
or for the destination directory of VOP_RENAME, for any case in which
the dire

tmpfs: Account for whiteouts during rename/rmdir

The existing tmpfs implementation will return ENOTEMPTY for VOP_RMDIR,
or for the destination directory of VOP_RENAME, for any case in which
the directory is non-empty, even if the directory only contains
whiteouts.

Fix this by tracking total whiteout dirent allocation separately for
each directory, and avoid returning ENOTEMPTY if IGNOREWHITEOUT has
been specified by the caller and the total allocation of dirents is not
greater than the total whiteout allocation. This addresses "directory
not empty" failures seen on some recently-added unionfs stress2 tests
which use tmpfs as a base-layer filesystem.

A separate issue for independent consideration is that unionfs' default
behavior when deleting files or directories is to create whiteouts even
when it does not truly need to do so.

Differential Revision: https://reviews.freebsd.org/D45987
Reviewed by: kib (prior version), olce
Tested by: pho

show more ...


# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remov

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BS

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 9ff2fbdf 13-Feb-2023 Konstantin Belousov <kib@FreeBSD.org>

tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts

VOP_ISLOCKED() does not return bool, its only reliable use it to check
that the vnode is exclusively locked by the calling thread. Almost all
ass

tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts

VOP_ISLOCKED() does not return bool, its only reliable use it to check
that the vnode is exclusively locked by the calling thread. Almost all
asserts of this form repeated auto-generated assertions from
vnode_if.src for VOPs, in the incorrect way.

In two places where the assertions would be meaningful, convert them to
ASSERT_VOP_LOCKED() statements.

Reviewed by: markj, mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38576

show more ...


# 3a3450ed 12-Feb-2023 Konstantin Belousov <kib@FreeBSD.org>

tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS()

Protect the call with the node lock. We cannot lock the fvp vnode
sleepable there, because we already own other participating vnode's

tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS()

Protect the call with the node lock. We cannot lock the fvp vnode
sleepable there, because we already own other participating vnode's
locks. Taking it without sleeping require unwinding the whole locking
state in one more place.

Note that the liveness of the node is guaranteed by the lock on the
parent directory vnode.

Reported and tested by: pho
Fixes: cbac1f3464956185cf95955344b6009e2cc3ae40ESC
Reviewed by: markj, mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38557

show more ...


# adc3506d 12-Feb-2023 Konstantin Belousov <kib@FreeBSD.org>

Extract tmpfs-specific part of tmpfs_access() into a helper

The helper tmpfs_access_locked() requires either the vnode or node
locked for consistency of the access check, unlike the pure vnode op.

Extract tmpfs-specific part of tmpfs_access() into a helper

The helper tmpfs_access_locked() requires either the vnode or node
locked for consistency of the access check, unlike the pure vnode op.

Reviewed by: markj, mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38557

show more ...


# 889f0746 12-Feb-2023 Konstantin Belousov <kib@FreeBSD.org>

tmpfs_access(): style fixes and remove redundand assertions

Note that MPASS(VOP_ISLOCKED(vp)) is simply broken.

Reviewed by: markj, mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after

tmpfs_access(): style fixes and remove redundand assertions

Note that MPASS(VOP_ISLOCKED(vp)) is simply broken.

Reviewed by: markj, mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38557

show more ...


# cbac1f34 02-Feb-2023 Fedor Uporov <fsu@FreeBSD.org>

Fix pjfstest issue tests/rename/09.t

Fix rename when renamed directory not owned by user,
but when user owns the sticky parent directory.

Reviewed by: kib
MFC after: 2 week
Differential rev

Fix pjfstest issue tests/rename/09.t

Fix rename when renamed directory not owned by user,
but when user owns the sticky parent directory.

Reviewed by: kib
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D38245

show more ...


# 56242a4c 05-Dec-2022 Fedor Uporov <fsu@FreeBSD.org>

Add extended attributes

The extattrs follows semantic of ufs, mean it cannot
be set to char/block devices and fifos. The attributes
are allocated using regular malloc with M_WAITOK
allocation with t

Add extended attributes

The extattrs follows semantic of ufs, mean it cannot
be set to char/block devices and fifos. The attributes
are allocated using regular malloc with M_WAITOK
allocation with the own malloc tag M_TMPFSEA. The memory
consumed by extended attributes is limited to avoid OOM
triggereing by tmpfs_mount variable tm_ea_memory_max,
which is set initialy to 16 MB. The extended attributes
entries are stored as linked list in the tmpfs node.
The mount point lock is required only under setextattr
and deleteextattr to update extended attributes
memory-inuse counter, all other operations are doing
under vnode lock.

Reviewed by: kib
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D38052

show more ...


# 0de4895a 26-Jan-2023 Fedor Uporov <fsu@FreeBSD.org>

Fix pjfstest issue tests/rename/23.t

This test creates two files like file0 and file1,
then creates link to file1 and checks ctime on it.
Then renames file0 to file1. Then checks ctime on
link again

Fix pjfstest issue tests/rename/23.t

This test creates two files like file0 and file1,
then creates link to file1 and checks ctime on it.
Then renames file0 to file1. Then checks ctime on
link again. It is expected, that second ctime will
be higher then first ctime, because rename happen.
Add ctime updating for directory entry,
which will be deleted on rename.

Reviewed by: kib
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D38051

show more ...


12345678910>>...35