opnsense-src/sys/conf
Mark Johnston f1f230439f 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
2025-07-04 14:42:33 +00:00
..
config.mk Retire non-NEW_PCIB code and remove config option 2024-07-18 18:55:12 +01:00
debuginfo.ldscript kernel: Add new dwarf symbols 2024-07-31 22:23:25 -06:00
dtb.build.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
dtb.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
files vfs: Initial revision of inotify 2025-07-04 14:42:33 +00:00
files.amd64 Revert "isp: Fix abort issue introduced by previous commit" 2025-01-08 13:20:09 -05:00
files.arm arm: Remove any reference to cpufunc_asm_arm11x6.S 2025-03-25 14:03:44 +01:00
files.arm64 arm64: add a GPIO driver for Apple Silicon 2025-04-02 20:11:33 -05:00
files.i386 files.x86: Pull in some more duplicate lines from files.{amd64,i386} 2024-04-12 14:35:45 -07:00
files.powerpc zfs: enable FPU on powerpc* 2025-03-28 17:19:29 +01:00
files.riscv riscv: support for Cache-Block Operations (CBO). 2025-04-22 10:03:45 +01:00
files.x86 AMD IOMMU driver 2024-11-03 01:45:40 +02:00
kern.mk kern.mk: Update SSP comment (not limited to GCC) 2025-03-14 16:21:34 -04:00
kern.opts.mk kern.opts.mk: Remove EFI from riscv BROKEN_OPTIONS 2025-03-28 13:56:55 -04:00
kern.post.mk sys: move SAN and COVERAGE options handling to kern.mk 2024-11-12 19:04:13 +00:00
kern.pre.mk conf: Fix KCSAN enablement checking 2024-11-17 16:40:33 +00:00
kmod.mk sys: move SAN and COVERAGE options handling to kern.mk 2024-11-12 19:04:13 +00:00
kmod.opts.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
kmod_syms.awk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
kmod_syms_prefix.awk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
ldscript.amd64 kernel: Fix defining of .init_array and .fini_array sections 2024-09-02 12:26:47 +08:00
ldscript.arm arm: link all .rodata variants into one output section 2024-11-17 12:35:55 +01:00
ldscript.arm64 arm64: Create an L3 table to limit permissions 2025-06-17 13:48:22 +01:00
ldscript.i386 kernel: Fix defining of .init_array and .fini_array sections 2024-09-02 12:26:47 +08:00
ldscript.kmod.amd64 sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ldscript.kmod.i386 sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ldscript.powerpc kernel: Add defination of .init_array and .fini_array for all other platforms 2024-09-02 12:26:48 +08:00
ldscript.powerpc64 kernel: Add defination of .init_array and .fini_array for all other platforms 2024-09-02 12:26:48 +08:00
ldscript.powerpc64le kernel: Add defination of .init_array and .fini_array for all other platforms 2024-09-02 12:26:48 +08:00
ldscript.powerpcspe kernel: Add defination of .init_array and .fini_array for all other platforms 2024-09-02 12:26:48 +08:00
ldscript.riscv kernel: Add defination of .init_array and .fini_array for all other platforms 2024-09-02 12:26:48 +08:00
Makefile.amd64 sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.arm genassym: Remove stale *if.h depends 2024-12-06 10:31:36 -07:00
Makefile.arm64 arm: Improve the creation of kernel.bin 2024-11-09 08:15:23 +01:00
Makefile.i386 sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.powerpc sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.riscv genassym: Remove stale *if.h depends 2024-12-06 10:31:36 -07:00
newvers.sh kernel: Print SOURCE_DATE_EPOCH in UTC 2025-02-03 15:58:32 -08:00
NOTES qat: add disable safe dc mode for QAT SPR devices 2025-06-06 13:42:58 +00:00
options Import the Hardware Trace (HWT) framework. 2025-07-03 15:48:34 +01:00
options.amd64 uart: Support EARLY_PRINTF on x86 for port-mapped COM ports 2023-10-20 16:07:24 -06:00
options.arm Remove OMAP4 support leftovers 2025-04-23 20:04:53 +02:00
options.arm64 arm64: Add a new SOC_ROCKCHIP option 2025-01-06 08:36:58 +01:00
options.i386 i386: Use DEV_HYPERV to enable HyperV APIC vector 2024-04-13 19:10:44 -07:00
options.powerpc sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
options.riscv riscv: Allwinner D1 clock and reset driver 2024-11-16 15:04:04 -04:00
std.debug netinet: default mib counter probe points off 2024-11-20 09:52:48 +01:00
std.nodebug netinet: default mib counter probe points off 2024-11-20 09:52:48 +01:00
sysent.mk Update mentions of makesyscalls.lua 2024-10-30 21:04:31 +00:00
systags.sh sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
vdso_amd64.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vdso_amd64_ia32.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
WITHOUT_SOURCELESS sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
WITHOUT_SOURCELESS_HOST sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
WITHOUT_SOURCELESS_UCODE sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00