Merge tag 'x86-urgent-2025-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / fs / nfsd / netlink.c
blobca54aa5835305ecb005f88ad723229a201a4cbe8
1 // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2 /* Do not edit directly, auto-generated from: */
3 /* Documentation/netlink/specs/nfsd.yaml */
4 /* YNL-GEN kernel source */
6 #include <net/netlink.h>
7 #include <net/genetlink.h>
9 #include "netlink.h"
11 #include <uapi/linux/nfsd_netlink.h>
13 /* Common nested types */
14 const struct nla_policy nfsd_sock_nl_policy[NFSD_A_SOCK_TRANSPORT_NAME + 1] = {
15 [NFSD_A_SOCK_ADDR] = { .type = NLA_BINARY, },
16 [NFSD_A_SOCK_TRANSPORT_NAME] = { .type = NLA_NUL_STRING, },
19 const struct nla_policy nfsd_version_nl_policy[NFSD_A_VERSION_ENABLED + 1] = {
20 [NFSD_A_VERSION_MAJOR] = { .type = NLA_U32, },
21 [NFSD_A_VERSION_MINOR] = { .type = NLA_U32, },
22 [NFSD_A_VERSION_ENABLED] = { .type = NLA_FLAG, },
25 /* NFSD_CMD_THREADS_SET - do */
26 static const struct nla_policy nfsd_threads_set_nl_policy[NFSD_A_SERVER_SCOPE + 1] = {
27 [NFSD_A_SERVER_THREADS] = { .type = NLA_U32, },
28 [NFSD_A_SERVER_GRACETIME] = { .type = NLA_U32, },
29 [NFSD_A_SERVER_LEASETIME] = { .type = NLA_U32, },
30 [NFSD_A_SERVER_SCOPE] = { .type = NLA_NUL_STRING, },
33 /* NFSD_CMD_VERSION_SET - do */
34 static const struct nla_policy nfsd_version_set_nl_policy[NFSD_A_SERVER_PROTO_VERSION + 1] = {
35 [NFSD_A_SERVER_PROTO_VERSION] = NLA_POLICY_NESTED(nfsd_version_nl_policy),
38 /* NFSD_CMD_LISTENER_SET - do */
39 static const struct nla_policy nfsd_listener_set_nl_policy[NFSD_A_SERVER_SOCK_ADDR + 1] = {
40 [NFSD_A_SERVER_SOCK_ADDR] = NLA_POLICY_NESTED(nfsd_sock_nl_policy),
43 /* NFSD_CMD_POOL_MODE_SET - do */
44 static const struct nla_policy nfsd_pool_mode_set_nl_policy[NFSD_A_POOL_MODE_MODE + 1] = {
45 [NFSD_A_POOL_MODE_MODE] = { .type = NLA_NUL_STRING, },
48 /* Ops table for nfsd */
49 static const struct genl_split_ops nfsd_nl_ops[] = {
51 .cmd = NFSD_CMD_RPC_STATUS_GET,
52 .dumpit = nfsd_nl_rpc_status_get_dumpit,
53 .flags = GENL_CMD_CAP_DUMP,
56 .cmd = NFSD_CMD_THREADS_SET,
57 .doit = nfsd_nl_threads_set_doit,
58 .policy = nfsd_threads_set_nl_policy,
59 .maxattr = NFSD_A_SERVER_SCOPE,
60 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
63 .cmd = NFSD_CMD_THREADS_GET,
64 .doit = nfsd_nl_threads_get_doit,
65 .flags = GENL_CMD_CAP_DO,
68 .cmd = NFSD_CMD_VERSION_SET,
69 .doit = nfsd_nl_version_set_doit,
70 .policy = nfsd_version_set_nl_policy,
71 .maxattr = NFSD_A_SERVER_PROTO_VERSION,
72 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
75 .cmd = NFSD_CMD_VERSION_GET,
76 .doit = nfsd_nl_version_get_doit,
77 .flags = GENL_CMD_CAP_DO,
80 .cmd = NFSD_CMD_LISTENER_SET,
81 .doit = nfsd_nl_listener_set_doit,
82 .policy = nfsd_listener_set_nl_policy,
83 .maxattr = NFSD_A_SERVER_SOCK_ADDR,
84 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
87 .cmd = NFSD_CMD_LISTENER_GET,
88 .doit = nfsd_nl_listener_get_doit,
89 .flags = GENL_CMD_CAP_DO,
92 .cmd = NFSD_CMD_POOL_MODE_SET,
93 .doit = nfsd_nl_pool_mode_set_doit,
94 .policy = nfsd_pool_mode_set_nl_policy,
95 .maxattr = NFSD_A_POOL_MODE_MODE,
96 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
99 .cmd = NFSD_CMD_POOL_MODE_GET,
100 .doit = nfsd_nl_pool_mode_get_doit,
101 .flags = GENL_CMD_CAP_DO,
105 struct genl_family nfsd_nl_family __ro_after_init = {
106 .name = NFSD_FAMILY_NAME,
107 .version = NFSD_FAMILY_VERSION,
108 .netnsok = true,
109 .parallel_ops = true,
110 .module = THIS_MODULE,
111 .split_ops = nfsd_nl_ops,
112 .n_split_ops = ARRAY_SIZE(nfsd_nl_ops),