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.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -59,12 +59,20 @@ enum { · 58 unmodified lines | ||
| 59 | 59 | SUNRPC_A_UNIX_GID_REQS_MAX = (__SUNRPC_A_UNIX_GID_REQS_MAX - 1) |
| 60 | 60 | }; |
| 61 | 61 | |
| 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 | + | |
| 62 | 69 | enum { |
| 63 | 70 | SUNRPC_CMD_CACHE_NOTIFY = 1, |
| 64 | 71 | SUNRPC_CMD_IP_MAP_GET_REQS, |
| 65 | 72 | SUNRPC_CMD_IP_MAP_SET_REQS, |
| 66 | 73 | SUNRPC_CMD_UNIX_GID_GET_REQS, |
| 67 | 74 | SUNRPC_CMD_UNIX_GID_SET_REQS, |
| 75 | + SUNRPC_CMD_CACHE_FLUSH, | |
| 68 | 76 | |
| 69 | 77 | __SUNRPC_CMD_MAX, |
| 70 | 78 | SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1) |