Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8a297a843 | ||
|
|
b22524091e |
@@ -10,7 +10,7 @@ currently-supported upstream scoutfs version.
|
||||
Three patches against each supported scoutfs release:
|
||||
|
||||
1. **Kmod core** — a per-mount 64 KiB ring of 64-byte notification records and
|
||||
a single-reader drain ioctl (`SCOUTFS_IOC_READ_NOTIFY`, nr 25). Emit is
|
||||
a single-reader drain ioctl (`SCOUTFS_IOC_READ_NOTIFY`, nr 26). Emit is
|
||||
non-blocking, drop-on-full; the monotonic `seq` field exposes drops to
|
||||
consumers. Three percpu counters (`notify_emitted`,
|
||||
`notify_dropped_ring_full`, `notify_reader_attached`). No mount option,
|
||||
@@ -25,9 +25,11 @@ Three patches against each supported scoutfs release:
|
||||
clients. Pure-stdlib Go; no external module dependencies. Shipped
|
||||
with a systemd template unit `scoutfs-notifyd@<mountpoint>.service`.
|
||||
|
||||
The notify ABI (`SCOUTFS_IOC_READ_NOTIFY` nr 25, 64-byte event record) is
|
||||
identical across all three supported scoutfs versions, so consumers and
|
||||
the daemon do not need per-version branching in their own code.
|
||||
The 64-byte event record layout is identical on every branch, so
|
||||
consumers and the daemon do not need per-version branching in their own
|
||||
code. The ioctl number is not: it is nr 25 on `v1.28`-`v1.30` and nr 26
|
||||
on `v1.32`, because upstream v1.32 took nr 25 for
|
||||
`SCOUTFS_IOC_INJECT_TOTL_DELTA`.
|
||||
|
||||
## Repository layout
|
||||
|
||||
@@ -40,6 +42,7 @@ NOT apply cross-version without rebasing.
|
||||
| `v1.28` | `v1.28` | `v1.28-notify-1` |
|
||||
| `v1.29` | `v1.29` | `v1.29-notify-1` |
|
||||
| `main` / `v1.30` | `v1.30` | `v1.30-notify-1` |
|
||||
| `v1.32` | `v1.32` | `v1.32-notify-1` |
|
||||
|
||||
`main` tracks the newest supported scoutfs version. When a new scoutfs
|
||||
release ships, a new branch is created and the patches are rebased onto
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6c5b791d47079df892ee25e6f17c22da2f643340 Mon Sep 17 00:00:00 2001
|
||||
From 50eba28d24c3b98c71d851c8093abc27a1835cce Mon Sep 17 00:00:00 2001
|
||||
From: William Gill <claude@williamgill.net>
|
||||
Date: Wed, 22 Apr 2026 14:38:51 -0500
|
||||
Subject: [PATCH 1/3] notify: core file-access notification infrastructure
|
||||
@@ -84,7 +84,7 @@ index 9088496..94e4f44 100644
|
||||
EXPAND_COUNTER(orphan_scan_attempts) \
|
||||
EXPAND_COUNTER(orphan_scan_cached) \
|
||||
diff --git a/kmod/src/ioctl.c b/kmod/src/ioctl.c
|
||||
index 0a5fc4c..b3a4d9a 100644
|
||||
index 156538a..4740ff0 100644
|
||||
--- a/kmod/src/ioctl.c
|
||||
+++ b/kmod/src/ioctl.c
|
||||
@@ -47,6 +47,7 @@
|
||||
@@ -95,22 +95,22 @@ index 0a5fc4c..b3a4d9a 100644
|
||||
#include "scoutfs_trace.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -1790,6 +1791,8 @@ long scoutfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
return scoutfs_ioc_read_xattr_index(file, arg);
|
||||
case SCOUTFS_IOC_PUNCH_OFFLINE:
|
||||
@@ -1829,6 +1830,8 @@ long scoutfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
return scoutfs_ioc_punch_offline(file, arg);
|
||||
case SCOUTFS_IOC_INJECT_TOTL_DELTA:
|
||||
return scoutfs_ioc_inject_totl_delta(file, arg);
|
||||
+ case SCOUTFS_IOC_READ_NOTIFY:
|
||||
+ return scoutfs_ioc_read_notify(file, arg);
|
||||
}
|
||||
|
||||
return -ENOTTY;
|
||||
diff --git a/kmod/src/ioctl.h b/kmod/src/ioctl.h
|
||||
index c0d2285..d468d4c 100644
|
||||
index 1bb466c..0ac8d24 100644
|
||||
--- a/kmod/src/ioctl.h
|
||||
+++ b/kmod/src/ioctl.h
|
||||
@@ -876,4 +876,88 @@ struct scoutfs_ioctl_punch_offline {
|
||||
#define SCOUTFS_IOC_PUNCH_OFFLINE \
|
||||
_IOW(SCOUTFS_IOCTL_MAGIC, 24, struct scoutfs_ioctl_punch_offline)
|
||||
@@ -889,4 +889,88 @@ struct scoutfs_ioctl_inject_totl_delta {
|
||||
#define SCOUTFS_IOC_INJECT_TOTL_DELTA \
|
||||
_IOW(SCOUTFS_IOCTL_MAGIC, 25, struct scoutfs_ioctl_inject_totl_delta)
|
||||
|
||||
+/*
|
||||
+ * File access notification stream (observer-only).
|
||||
@@ -194,7 +194,7 @@ index c0d2285..d468d4c 100644
|
||||
+};
|
||||
+
|
||||
+#define SCOUTFS_IOC_READ_NOTIFY \
|
||||
+ _IOWR(SCOUTFS_IOCTL_MAGIC, 25, struct scoutfs_ioctl_read_notify)
|
||||
+ _IOWR(SCOUTFS_IOCTL_MAGIC, 26, struct scoutfs_ioctl_read_notify)
|
||||
+
|
||||
#endif
|
||||
diff --git a/kmod/src/notify.c b/kmod/src/notify.c
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 496b47ab6dab052baecdfbabb0c92649a89d65b4 Mon Sep 17 00:00:00 2001
|
||||
From 482c0be372e2982cd7ca9ad7c0ea3522437886c6 Mon Sep 17 00:00:00 2001
|
||||
From: William Gill <claude@williamgill.net>
|
||||
Date: Wed, 22 Apr 2026 14:40:04 -0500
|
||||
Subject: [PATCH 2/3] notify: file open/read hook sites
|
||||
@@ -37,7 +37,7 @@ Nothing in the data-waiter state machine is touched.
|
||||
2 files changed, 39 insertions(+)
|
||||
|
||||
diff --git a/kmod/src/data.c b/kmod/src/data.c
|
||||
index 0abb48c..33a61af 100644
|
||||
index b6ca5eb..439ce09 100644
|
||||
--- a/kmod/src/data.c
|
||||
+++ b/kmod/src/data.c
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -48,7 +48,7 @@ index 0abb48c..33a61af 100644
|
||||
|
||||
/*
|
||||
* We want to amortize work done after dirtying the shared transaction
|
||||
@@ -2304,6 +2305,32 @@ const struct address_space_operations scoutfs_file_aops = {
|
||||
@@ -2312,6 +2313,32 @@ const struct address_space_operations scoutfs_file_aops = {
|
||||
.write_end = scoutfs_write_end,
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ index 0abb48c..33a61af 100644
|
||||
const struct file_operations scoutfs_file_fops = {
|
||||
#ifdef KC_LINUX_HAVE_FOP_AIO_READ
|
||||
.read = do_sync_read,
|
||||
@@ -2316,6 +2343,7 @@ const struct file_operations scoutfs_file_fops = {
|
||||
@@ -2324,6 +2351,7 @@ const struct file_operations scoutfs_file_fops = {
|
||||
.splice_read = generic_file_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b6cbfc46485cb9b7f5e87d0ff451f81c25d7d41c Mon Sep 17 00:00:00 2001
|
||||
From 31ef1c5ff1522a6de4501ff41fed0d72ecb57e8d Mon Sep 17 00:00:00 2001
|
||||
From: William Gill <claude@williamgill.net>
|
||||
Date: Wed, 22 Apr 2026 14:40:34 -0500
|
||||
Subject: [PATCH 3/3] notify: scoutfs-notifyd userspace relay daemon (Go 1.26)
|
||||
@@ -72,10 +72,10 @@ recv() events.
|
||||
utils/Makefile | 28 +-
|
||||
utils/man/scoutfs-notifyd.8 | 120 +++++++
|
||||
utils/notifyd/go.mod | 3 +
|
||||
utils/notifyd/main.go | 434 +++++++++++++++++++++++++
|
||||
utils/notifyd/main.go | 437 +++++++++++++++++++++++++
|
||||
utils/notifyd/scoutfs-notifyd@.service | 40 +++
|
||||
utils/scoutfs-utils.spec.in | 8 +
|
||||
6 files changed, 630 insertions(+), 3 deletions(-)
|
||||
6 files changed, 633 insertions(+), 3 deletions(-)
|
||||
create mode 100644 utils/man/scoutfs-notifyd.8
|
||||
create mode 100644 utils/notifyd/go.mod
|
||||
create mode 100644 utils/notifyd/main.go
|
||||
@@ -274,10 +274,10 @@ index 0000000..d99f395
|
||||
+go 1.26
|
||||
diff --git a/utils/notifyd/main.go b/utils/notifyd/main.go
|
||||
new file mode 100644
|
||||
index 0000000..9478bae
|
||||
index 0000000..41b98ab
|
||||
--- /dev/null
|
||||
+++ b/utils/notifyd/main.go
|
||||
@@ -0,0 +1,434 @@
|
||||
@@ -0,0 +1,437 @@
|
||||
+// Copyright (C) 2026 Versity Software, Inc. All rights reserved.
|
||||
+//
|
||||
+// This program is free software; you can redistribute it and/or
|
||||
@@ -396,8 +396,11 @@ index 0000000..9478bae
|
||||
+var (
|
||||
+ scoutfsIocStatfsMore = iocEncode(iocDirRead,
|
||||
+ scoutfsIoctlMagic, 10, statfsMoreSize)
|
||||
+ // nr must match SCOUTFS_IOC_READ_NOTIFY in kmod/src/ioctl.h. On the
|
||||
+ // v1.32 base this is 26: upstream v1.32 took nr 25 for
|
||||
+ // SCOUTFS_IOC_INJECT_TOTL_DELTA, so the notify ioctl moved to 26.
|
||||
+ scoutfsIocReadNotify = iocEncode(iocDirRead|iocDirWrite,
|
||||
+ scoutfsIoctlMagic, 25, readNotifySize)
|
||||
+ scoutfsIoctlMagic, 26, readNotifySize)
|
||||
+)
|
||||
+
|
||||
+func init() {
|
||||
|
||||
Reference in New Issue
Block a user