summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2026-03-25 17:40:28 +0300
committerChuck Lever <chuck.lever@oracle.com>2026-06-01 18:08:18 +0300
commitaf81cb247ca94e4bcfea31ea862cf3aaf955a503 (patch)
treede9046636c5a30bea2540815de0fa2c8403ed8e8 /include/uapi
parentc13ecd47648cc98e9f324ce4bcaa3d0654c3c91c (diff)
downloadlinux-af81cb247ca94e4bcfea31ea862cf3aaf955a503.tar.xz
sunrpc: add a generic netlink family for cache upcalls
The auth.unix.ip and auth.unix.gid caches live in the sunrpc module, so they cannot use the nfsd generic netlink family. Create a new "sunrpc" generic netlink family with its own "exportd" multicast group to support cache upcall notifications for sunrpc-resident caches. Define a YAML spec (sunrpc_cache.yaml) with a cache-type enum (ip_map, unix_gid), a cache-notify multicast event, and the corresponding uapi header. Implement sunrpc_cache_notify() in cache.c, which checks for listeners on the exportd multicast group, builds and sends a SUNRPC_CMD_CACHE_NOTIFY message with the cache-type attribute. Register/unregister the sunrpc_nl_family in init_sunrpc() and cleanup_sunrpc(). Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/sunrpc_netlink.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/uapi/linux/sunrpc_netlink.h b/include/uapi/linux/sunrpc_netlink.h
new file mode 100644
index 000000000000..6135d9b3eef1
--- /dev/null
+++ b/include/uapi/linux/sunrpc_netlink.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
+/* Do not edit directly, auto-generated from: */
+/* Documentation/netlink/specs/sunrpc_cache.yaml */
+/* YNL-GEN uapi header */
+/* To regenerate run: tools/net/ynl/ynl-regen.sh */
+
+#ifndef _UAPI_LINUX_SUNRPC_NETLINK_H
+#define _UAPI_LINUX_SUNRPC_NETLINK_H
+
+#define SUNRPC_FAMILY_NAME "sunrpc"
+#define SUNRPC_FAMILY_VERSION 1
+
+enum sunrpc_cache_type {
+ SUNRPC_CACHE_TYPE_IP_MAP = 1,
+ SUNRPC_CACHE_TYPE_UNIX_GID = 2,
+};
+
+enum {
+ SUNRPC_A_CACHE_NOTIFY_CACHE_TYPE = 1,
+
+ __SUNRPC_A_CACHE_NOTIFY_MAX,
+ SUNRPC_A_CACHE_NOTIFY_MAX = (__SUNRPC_A_CACHE_NOTIFY_MAX - 1)
+};
+
+enum {
+ SUNRPC_CMD_CACHE_NOTIFY = 1,
+
+ __SUNRPC_CMD_MAX,
+ SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)
+};
+
+#define SUNRPC_MCGRP_NONE "none"
+#define SUNRPC_MCGRP_EXPORTD "exportd"
+
+#endif /* _UAPI_LINUX_SUNRPC_NETLINK_H */