| #
5e395c34
|
| 26-Sep-2025 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: stop using SDT_PROBES_ENABLED in inlined ops
No point after hot patching was introduced.
|
| #
3bd8fab2
|
| 17-Jul-2025 |
Mark Johnston <markj@FreeBSD.org> |
vfs: Move DEBUG_VFS_LOCKS checks to INVARIANTS
It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no vnode lock assertions are checked when INVARIANTS is configured, so bugs can a
vfs: Move DEBUG_VFS_LOCKS checks to INVARIANTS
It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no vnode lock assertions are checked when INVARIANTS is configured, so bugs can arise. This has happened to me more than once, and the overhead over DEBUG_VFS_LOCKS does not appear to be high enough to prohibit folding it into INVARIANTS, so let's do that.
The change makes vnode lock assertions useful in plain INVARIANTS kernels, and guards VOP debug routines on INVARIANTS rather than DEBUG_VFS_LOCKS. Further, invariants are now checked by plain assertions rather than having various sysctls to finely control what happens the checks fail. The extra complexity didn't seem particularly useful and is at odds with how we handle debugging most everywhere else.
Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51402
show more ...
|
| #
f1f23043
|
| 03-Jul-2025 |
Mark Johnston <markj@FreeBSD.org> |
vfs: Initial revision of inotify
Add an implementation of inotify_init(), inotify_add_watch(), inotify_rm_watch(), source-compatible with Linux. This provides functionality similar to kevent(2)'s E
vfs: Initial revision of inotify
Add an implementation of inotify_init(), inotify_add_watch(), inotify_rm_watch(), source-compatible with Linux. This provides functionality similar to kevent(2)'s EVFILT_VNODE, i.e., it lets applications monitor filesystem files for accesses. Compared to inotify, however, EVFILT_VNODE has the limitation of requiring the application to open the file to be monitored. This means that activity on a newly created file cannot be monitored reliably, and that a file descriptor per file in the hierarchy is required.
inotify on the other hand allows a directory and its entries to be monitored at once. It introduces a new file descriptor type to which "watches" can be attached; a watch is a pseudo-file descriptor associated with a file or directory and a set of events to watch for. When a watched vnode is accessed, a description of the event is queued to the inotify descriptor, readable with read(2). Events for files in a watched directory include the file name.
A watched vnode has its usecount bumped, so name cache entries originating from a watched directory are not evicted. Name cache entries are used to populate inotify events for files with a link in a watched directory. In particular, if a file is accessed with, say, read(2), an IN_ACCESS event will be generated for any watched hard link of the file.
The inotify_add_watch_at() variant is included so that this functionality is available in capability mode; plain inotify_add_watch() is disallowed in capability mode.
When a file in a nullfs mount is watched, the watch is attached to the lower vnode, such that accesses via either layer generate inotify events.
Many thanks to Gleb Popov for testing this patch and finding lots of bugs.
PR: 258010, 215011 Reviewed by: kib Tested by: arrowd MFC after: 3 months Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50315
show more ...
|
| #
903d2946
|
| 22-May-2025 |
Mark Johnston <markj@FreeBSD.org> |
vnode_if: Remove some branching around SDT probes in VOP wrappers
Now that SDT is implemented using hot-patching, SDT_PROBE* no longer introduces a branch instruction, so the SDT_PROBES_ENABLED() ch
vnode_if: Remove some branching around SDT probes in VOP wrappers
Now that SDT is implemented using hot-patching, SDT_PROBE* no longer introduces a branch instruction, so the SDT_PROBES_ENABLED() check in each VOP_*_APV() is not really worth preserving.
Reviewed by: olce, kib Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50423
show more ...
|
| #
cd048d5d
|
| 25-Nov-2024 |
Mark Johnston <markj@FreeBSD.org> |
vnode: Make the vop_vector reference a pointer to const
No functional change intended.
MFC after: 1 week
|
| #
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 ...
|
| #
031beb4e
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| #
750a49b6
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
vnode_if: Don't add $FreeBSD$ to the output
Sponsored by: Netflix
|
| #
5f6df177
|
| 03-Nov-2021 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: validate that vop vectors provide all or none fplookup vops
In order to prevent later susprises.
|
| #
5a4a83fd
|
| 16-Jan-2023 |
Jason A. Harmening <jah@FreeBSD.org> |
Improve debuggability of VOP_* locking assertions
Include the phase and argument field to make it easier to determine at a glance where the failure originated.
Reviewed by: kib, markj Differential
Improve debuggability of VOP_* locking assertions
Include the phase and argument field to make it easier to determine at a glance where the failure originated.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D38091
show more ...
|
| #
c7aa572c
|
| 31-Jul-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
| #
17996960
|
| 31-Jul-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r363583 through r363738.
|
| #
848f8eff
|
| 30-Jul-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: inline vops if there are no pre/post associated calls
This removes a level of indirection from frequently used methods, most notably VOP_LOCK1 and VOP_UNLOCK1.
Tested by: pho
|
| #
773bec08
|
| 27-Jan-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357119 through r357178.
|
| #
8a6f5fd5
|
| 26-Jan-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: stop null checking routines in vop wrappers
Calls to vop_bypass pass the same argument, but type casted to something else. Thus by replacing NULL routines with vop_bypass we avoid a runtime che
vfs: stop null checking routines in vop wrappers
Calls to vop_bypass pass the same argument, but type casted to something else. Thus by replacing NULL routines with vop_bypass we avoid a runtime check.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23357
show more ...
|
| #
61f67f32
|
| 16-Dec-2019 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: allow tail call optimisation in vops in the common case
Most frequently used vops boil down to checking SDT probes, doing the call and checking again. There is no vop_post/pre in their case but
vfs: allow tail call optimisation in vops in the common case
Most frequently used vops boil down to checking SDT probes, doing the call and checking again. There is no vop_post/pre in their case but the check after the call prevents tail call optimisation from taking place. Instead, check once upfront. Kernels with debug or vops with non-empty vop_post still don't short circuit.
Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22739
show more ...
|
| #
6fa079fc
|
| 16-Dec-2019 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: flatten vop vectors
This eliminates the following loop from all VOP calls:
while(vop != NULL && \ vop->vop_spare2 == NULL && vop->vop_bypass == NULL) vop = vop->vop_default;
Revie
vfs: flatten vop vectors
This eliminates the following loop from all VOP calls:
while(vop != NULL && \ vop->vop_spare2 == NULL && vop->vop_bypass == NULL) vop = vop->vop_default;
Reviewed by: jeff Tesetd by: pho Differential Revision: https://reviews.freebsd.org/D22738
show more ...
|
| #
7648bc9f
|
| 13-May-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @347527
Sponsored by: The FreeBSD Foundation
|
| #
52bcb118
|
| 08-May-2019 |
Ed Maste <emaste@FreeBSD.org> |
Avoid literal @generated tag in file-generating scripts
We don't want the generator itself tagged as a generated file.
Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: h
Avoid literal @generated tag in file-generating scripts
We don't want the generator itself tagged as a generated file.
Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20182
show more ...
|
| #
6e0e532a
|
| 07-May-2019 |
Ed Maste <emaste@FreeBSD.org> |
Use @generated tag in generated files
Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generat
Use @generated tag in generated files
Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generated tag in makeobjops.awk and vnode_if.awk as we've done for other generated files.
Sponsored by: The FreeBSD Foundation
show more ...
|
| #
fda9adaf
|
| 27-Oct-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339670 through r339812.
|
| #
8ff7fad1
|
| 23-Oct-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Only call sigdeferstop() for NFS.
Use bypass to catch any NFS VOP dispatch and route it through the wrapper which does sigdeferstop() and then dispatches original VOP. NFS does not need a bypass bel
Only call sigdeferstop() for NFS.
Use bypass to catch any NFS VOP dispatch and route it through the wrapper which does sigdeferstop() and then dispatches original VOP. NFS does not need a bypass below it, which is not supported.
The vop offset in the vop_vector is added since otherwise it is impossible to get vop_op_t from the internal table, and I did not wanted to create the layered fs only to wrap NFS VOPs.
VFS_OP()s wrap is straightforward.
Requested and reviewed by: mjg (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17658
show more ...
|
| #
5e395c34
|
| 26-Sep-2025 |
Mateusz Guzik <mjg@FreeBSD.org> |
vfs: stop using SDT_PROBES_ENABLED in inlined ops
No point after hot patching was introduced.
|
| #
3bd8fab2
|
| 17-Jul-2025 |
Mark Johnston <markj@FreeBSD.org> |
vfs: Move DEBUG_VFS_LOCKS checks to INVARIANTS
It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no vnode lock assertions are checked when INVARIANTS is configured, so bugs can a
vfs: Move DEBUG_VFS_LOCKS checks to INVARIANTS
It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no vnode lock assertions are checked when INVARIANTS is configured, so bugs can arise. This has happened to me more than once, and the overhead over DEBUG_VFS_LOCKS does not appear to be high enough to prohibit folding it into INVARIANTS, so let's do that.
The change makes vnode lock assertions useful in plain INVARIANTS kernels, and guards VOP debug routines on INVARIANTS rather than DEBUG_VFS_LOCKS. Further, invariants are now checked by plain assertions rather than having various sysctls to finely control what happens the checks fail. The extra complexity didn't seem particularly useful and is at odds with how we handle debugging most everywhere else.
Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51402
show more ...
|
| #
f1f23043
|
| 03-Jul-2025 |
Mark Johnston <markj@FreeBSD.org> |
vfs: Initial revision of inotify
Add an implementation of inotify_init(), inotify_add_watch(), inotify_rm_watch(), source-compatible with Linux. This provides functionality similar to kevent(2)'s E
vfs: Initial revision of inotify
Add an implementation of inotify_init(), inotify_add_watch(), inotify_rm_watch(), source-compatible with Linux. This provides functionality similar to kevent(2)'s EVFILT_VNODE, i.e., it lets applications monitor filesystem files for accesses. Compared to inotify, however, EVFILT_VNODE has the limitation of requiring the application to open the file to be monitored. This means that activity on a newly created file cannot be monitored reliably, and that a file descriptor per file in the hierarchy is required.
inotify on the other hand allows a directory and its entries to be monitored at once. It introduces a new file descriptor type to which "watches" can be attached; a watch is a pseudo-file descriptor associated with a file or directory and a set of events to watch for. When a watched vnode is accessed, a description of the event is queued to the inotify descriptor, readable with read(2). Events for files in a watched directory include the file name.
A watched vnode has its usecount bumped, so name cache entries originating from a watched directory are not evicted. Name cache entries are used to populate inotify events for files with a link in a watched directory. In particular, if a file is accessed with, say, read(2), an IN_ACCESS event will be generated for any watched hard link of the file.
The inotify_add_watch_at() variant is included so that this functionality is available in capability mode; plain inotify_add_watch() is disallowed in capability mode.
When a file in a nullfs mount is watched, the watch is attached to the lower vnode, such that accesses via either layer generate inotify events.
Many thanks to Gleb Popov for testing this patch and finding lots of bugs.
PR: 258010, 215011 Reviewed by: kib Tested by: arrowd MFC after: 3 months Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50315
show more ...
|