History log of /freebsd/sys/kern/vfs_vnops.c (Results 1 – 25 of 1024)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# ef9ffb85 25-Nov-2024 Mark Johnston <markj@FreeBSD.org>

kern: Make fileops and filterops tables const where possible

No functional change intended.

MFC after: 1 week


Revision tags: release/13.4.0, release/14.1.0
# 473c90ac 10-May-2024 John Baldwin <jhb@FreeBSD.org>

uio: Use switch statements when handling UIO_READ vs UIO_WRITE

This is mostly to reduce the diff with CheriBSD which adds additional
constants to enum uio_rw, but also matches the normal style used

uio: Use switch statements when handling UIO_READ vs UIO_WRITE

This is mostly to reduce the diff with CheriBSD which adds additional
constants to enum uio_rw, but also matches the normal style used for
uio_segflg.

Reviewed by: kib, emaste
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D45142

show more ...


# 08f3d5b6 04-Apr-2024 Mark Johnston <markj@FreeBSD.org>

copy_file_range: Call vn_rdwr() at least once

This ensures that we invoke VOP_READ on the input file even if it's
empty, which in turn helps ensure that filesystems update the atime of
the file.

PR

copy_file_range: Call vn_rdwr() at least once

This ensures that we invoke VOP_READ on the input file even if it's
empty, which in turn helps ensure that filesystems update the atime of
the file.

PR: 274615
Reviewed by: olce, rmacklem, kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43524

show more ...


# 89f1dcb3 15-Mar-2024 Rick Macklem <rmacklem@FreeBSD.org>

vfs_vnops.c: Use va_bytes >= va_size hint to avoid SEEK_DATA/SEEKHOLE

vn_generic_copy_file_range() tries to maintain holes
in file ranges being copied, using SEEK_DATA/SEEK_HOLE
where possible,

Unf

vfs_vnops.c: Use va_bytes >= va_size hint to avoid SEEK_DATA/SEEKHOLE

vn_generic_copy_file_range() tries to maintain holes
in file ranges being copied, using SEEK_DATA/SEEK_HOLE
where possible,

Unfortunately SEEK_DATA/SEEK_HOLE operations can take
a long time under certain circumstances.
Although it is not currently possible to know if a file has
unallocated data regions, the case where va_bytes >= va_size
is a strong hint that there are no unallocated data regions.
This hint does not work well for file systems doing compression,
but since it is only a hint, it is still useful.

For the case of va_bytes >= va_size, avoid doing SEEK_DATA/SEEK_HOLE.

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

show more ...


Revision tags: release/13.3.0
# fa26f46d 23-Feb-2024 Jason A. Harmening <jah@FreeBSD.org>

vn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL

It's a bit strange to require the caller to pass contrived lock flags
if the corresponding vnode is NULL, simply to appease the ass

vn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL

It's a bit strange to require the caller to pass contrived lock flags
if the corresponding vnode is NULL, simply to appease the assertion
that exactly one of LK_SHARED or LK_EXCLUSIVE must be set. On the
other hand, we still want to catch cases in which completely bogus
or corrupt flags are passed even if the corresponding vnode is NULL.
Therefore, specifically allow empty flags for lkflags1/lkflags2 iff
the respective vp1/vp2 param is NULL.

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

show more ...


# 61cc4830 18-Jan-2024 Alfredo Mazzinghi <am2419@cl.cam.ac.uk>

Abstract UIO allocation and deallocation.

Introduce the allocuio() and freeuio() functions to allocate and
deallocate struct uio. This hides the actual allocator interface, so it
is easier to modify

Abstract UIO allocation and deallocation.

Introduce the allocuio() and freeuio() functions to allocate and
deallocate struct uio. This hides the actual allocator interface, so it
is easier to modify the sub-allocation layout of struct uio and the
corresponding iovec array.

Obtained from: CheriBSD
Reviewed by: kib, markj
MFC after: 2 weeks
Sponsored by: CHaOS, EPSRC grant EP/V000292/1
Differential Revision: https://reviews.freebsd.org/D43711

show more ...


# f04220c1 19-Jan-2024 Konstantin Belousov <kib@FreeBSD.org>

kcmp(2): implement for vnode files

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


# b068bb09 08-Jan-2024 Konstantin Belousov <kib@FreeBSD.org>

Add vnode_pager_clean_{a,}sync(9)

Bump __FreeBSD_version for ZFS use.

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

Add vnode_pager_clean_{a,}sync(9)

Bump __FreeBSD_version for ZFS use.

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

show more ...


# 2319ca6a 01-Jan-2024 Rick Macklem <rmacklem@FreeBSD.org>

vfs_vnops.c: Fix vn_generic_copy_file_range() for truncation

When copy_file_range(2) was first being developed,
*inoffp + len had to be <= infile_size or an error was
returned. This semantic (as def

vfs_vnops.c: Fix vn_generic_copy_file_range() for truncation

When copy_file_range(2) was first being developed,
*inoffp + len had to be <= infile_size or an error was
returned. This semantic (as defined by Linux) changed
to allow *inoffp + len to be greater than infile_size and
the copy would end at *inoffp + infile_size.

Unfortunately, the code that decided if the outfd should
be truncated in length did not get updated for this
semantics change.
As such, if a copy_file_range(2) is done, where infile_size - *inoffp
is less that outfile_size but len is large, the outfd file is truncated
when it should not be. (The semantics for this for Linux is to not
truncate outfd in this case.)

This patch fixes the problem. I believe the calculation is safe
for all non-negative values of outsize, *outoffp, *inoffp and insize,
which should be ok, since they are all guaranteed to be non-negative.

Note that this bug is not observed over NFSv4.2, since it truncates
len to infile_size - *inoffp.

PR: 276045
Reviewed by: asomers, kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D43258

show more ...


# c5405d1c 18-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

vn_copy_file_range(): provide ENOSYS fallback to vn_generic_copy_file_range()

Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Dif

vn_copy_file_range(): provide ENOSYS fallback to vn_generic_copy_file_range()

Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42603

show more ...


# a9bc8637 18-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

vn_copy_file_range(): find write vnodes on which to call the VOP

Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential rev

vn_copy_file_range(): find write vnodes on which to call the VOP

Reviewed by: markj, Olivier Certner <olce.freebsd@certner.fr>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42603

show more ...


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 305a2676 19-Nov-2023 Mateusz Guzik <mjg@FreeBSD.org>

vfs: dodge locking for lseek(fd, 0, SEEK_CUR)

It is very common and according to dtrace while running poudriere almost
all calls with SEEK_CUR pass 0.


# 22bac49b 16-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

vn_lock_pair(): reasonably handle vp1 == vp2 case

Lock the vnode in the most exclusive lock mode requested, once.
All callers already ensure that vp1 != vp2 or are careful enough to only
unlock once

vn_lock_pair(): reasonably handle vp1 == vp2 case

Lock the vnode in the most exclusive lock mode requested, once.
All callers already ensure that vp1 != vp2 or are careful enough to only
unlock once otherwise.

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

show more ...


# 23210f53 12-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

vn_copy_file_range(): busy both in and out mp around call to VOP_COPY_FILE_RANGE()

This is required e.g. for nullfs to ensure liveness of the lower mount
points.

Reviewed by: jah, rmacklem, Olivier

vn_copy_file_range(): busy both in and out mp around call to VOP_COPY_FILE_RANGE()

This is required e.g. for nullfs to ensure liveness of the lower mount
points.

Reviewed by: jah, rmacklem, Olivier Certner <olce.freebsd@certner.fr>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42554

show more ...


# 89188bd6 12-Nov-2023 Konstantin Belousov <kib@FreeBSD.org>

vn_copy_file_range(): use local variables for invp/outvp vnodes v_mounts

This avoids possible NULL dereference when checking mnt_vfc names.

Reviewed by: jah, rmacklem, Olivier Certner <olce.freebsd

vn_copy_file_range(): use local variables for invp/outvp vnodes v_mounts

This avoids possible NULL dereference when checking mnt_vfc names.

Reviewed by: jah, rmacklem, Olivier Certner <olce.freebsd@certner.fr>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42554

show more ...


Revision tags: release/14.0.0
# 969071be 06-Sep-2023 Martin Matuska <mm@FreeBSD.org>

vfs: copy_file_range() between multiple mountpoints of the same fs type

VOP_COPY_FILE_RANGE(9) is now caled when source and target vnodes
reside on the same filesystem type (not just on the same mou

vfs: copy_file_range() between multiple mountpoints of the same fs type

VOP_COPY_FILE_RANGE(9) is now caled when source and target vnodes
reside on the same filesystem type (not just on the same mountpoint).
The check if vnodes are on the same mountpoint must be done in the
filesystem code. There are currently only three users - fusefs(5) already
has this check, ZFS can handle multiple mountpoints and a check has been
added to NFS client.

ZFS block cloning is now possible between all snapshots and datasets
of the same ZFS pool.

MFC after: 1 week
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D41721

show more ...


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

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

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


# 821dec4d 06-Aug-2023 Konstantin Belousov <kib@FreeBSD.org>

vnode io: request range-locking when pgcache reads are enabled

PR: 272678
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41334


# 651fdc3d 06-Aug-2023 Konstantin Belousov <kib@FreeBSD.org>

Revert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()"

This reverts commit 5b353925ff61b9ddb97bb453ba75278b578ed7d9.

The reason is the lesser scalability of the vnode' ra

Revert "vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()"

This reverts commit 5b353925ff61b9ddb97bb453ba75278b578ed7d9.

The reason is the lesser scalability of the vnode' rangelock comparing
with the vnode lock.

Requested by: mjg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41334

show more ...


# 5b353925 23-Jul-2023 Konstantin Belousov <kib@FreeBSD.org>

vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()

To ensure atomicity of reads against parallel writes and truncates,
vnode lock was not enough at least since introduction of

vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()

To ensure atomicity of reads against parallel writes and truncates,
vnode lock was not enough at least since introduction of vn_io_fault().
That code only take rangelock when it was possible that vn_read() and
vn_write() could drop the vnode lock.

At least since the introduction of VOP_READ_PGCACHE() which generally
does not lock the vnode at all, rangelocks become required even
for filesystems that do not need vn_io_fault() workaround. For
instance, tmpfs.

PR: 272678
Analyzed and reviewed by: Andrew Gierth <andrew@tao11.riddles.org.uk>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D41158

show more ...


# e38c634b 19-Jul-2023 Dmitry Chagin <dchagin@FreeBSD.org>

vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D41070


# f5837839 09-Jul-2023 Olivier Certner <olce.freebsd@certner.fr>

vn_lock_pair(): Support passing LK_NODDLKTREAT

Since this function ultimately calls vn_lock() or VOP_LOCK1(), allows it to
receive and pass this flag which is used in the lookup code and doesn't
int

vn_lock_pair(): Support passing LK_NODDLKTREAT

Since this function ultimately calls vn_lock() or VOP_LOCK1(), allows it to
receive and pass this flag which is used in the lookup code and doesn't
interfere with the function's operation.

Reviewed by: kib, markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40954

show more ...


# 2544b8e0 28-Apr-2023 Olivier Certner <olce.freebsd@certner.fr>

vfs: Rename vfs_emptydir() to vn_dir_check_empty()

No functional change. While here, adapt comments to style(9).

Reviewed by: kib
MFC after: 1 week


# c21d87a8 28-Apr-2023 Olivier Certner <olce.freebsd@certner.fr>

vfs: vn_dir_next_dirent(): Adapt comments to style(9)

No functional change.

Reviewed by: kib
MFC after: 1 week


12345678910>>...41