History

sunrpc: add SUNRPC_CMD_CACHE_FLUSH netlink command

Add a new SUNRPC_CMD_CACHE_FLUSH generic netlink command that allows userspace to flush the sunrpc auth caches (ip_map and unix_gid) without writing to /proc/net/rpc/*/flush. An optional SUNRPC_A_CACHE_FLUSH_MASK u32 attribute selects which caches to flush (bit 1 = ip_map, bit 2 = unix_gid). If the attribute is omitted, all sunrpc caches are flushed. This is used by exportfs to replace its /proc-based cache_flush() with a netlink equivalent, with /proc fallback for older kernels.

Jeff Layton committed 7 months ago

Commit 565ee231 parent 01c23055 files · +70 −0Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/sunrpc_netlink.h+8−0
@@ -59,12 +59,20 @@ enum { · 58 unmodified lines
5959 SUNRPC_A_UNIX_GID_REQS_MAX = (__SUNRPC_A_UNIX_GID_REQS_MAX - 1)
6060 };
6161
62+enum {
63+ SUNRPC_A_CACHE_FLUSH_MASK = 1,
64+
65+ __SUNRPC_A_CACHE_FLUSH_MAX,
66+ SUNRPC_A_CACHE_FLUSH_MAX = (__SUNRPC_A_CACHE_FLUSH_MAX - 1)
67+};
68+
6269 enum {
6370 SUNRPC_CMD_CACHE_NOTIFY = 1,
6471 SUNRPC_CMD_IP_MAP_GET_REQS,
6572 SUNRPC_CMD_IP_MAP_SET_REQS,
6673 SUNRPC_CMD_UNIX_GID_GET_REQS,
6774 SUNRPC_CMD_UNIX_GID_SET_REQS,
75+ SUNRPC_CMD_CACHE_FLUSH,
6876
6977 __SUNRPC_CMD_MAX,
7078 SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)