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
59 SUNRPC_A_UNIX_GID_REQS_MAX = (__SUNRPC_A_UNIX_GID_REQS_MAX - 1)59 SUNRPC_A_UNIX_GID_REQS_MAX = (__SUNRPC_A_UNIX_GID_REQS_MAX - 1)
60};60};
61 61
62enum {
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
62enum {69enum {
63 SUNRPC_CMD_CACHE_NOTIFY = 1,70 SUNRPC_CMD_CACHE_NOTIFY = 1,
64 SUNRPC_CMD_IP_MAP_GET_REQS,71 SUNRPC_CMD_IP_MAP_GET_REQS,
65 SUNRPC_CMD_IP_MAP_SET_REQS,72 SUNRPC_CMD_IP_MAP_SET_REQS,
66 SUNRPC_CMD_UNIX_GID_GET_REQS,73 SUNRPC_CMD_UNIX_GID_GET_REQS,
67 SUNRPC_CMD_UNIX_GID_SET_REQS,74 SUNRPC_CMD_UNIX_GID_SET_REQS,
75 SUNRPC_CMD_CACHE_FLUSH,
68 76
69 __SUNRPC_CMD_MAX,77 __SUNRPC_CMD_MAX,
70 SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)78 SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)