]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drbd: move UAPI headers to include/uapi/linux/
authorChristoph Böhmwalder <christoph.boehmwalder@linbit.com>
Wed, 6 May 2026 12:45:40 +0000 (14:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2026 01:23:23 +0000 (19:23 -0600)
drbd.h and drbd_limits.h contain only type definitions, enums, and
constants shared between kernel and userspace. These should be part of
UAPI.

Split the genl_api header into two: the genlmsghdr and the enums are
UAPI, the rest stays there for now (it will be removed by one of the
next commits in this series).

drbd_config.h is clearly DRBD-internal, so move it there.

Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20260506124541.1951772-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_buildtag.c
drivers/block/drbd/drbd_config.h [moved from include/linux/drbd_config.h with 100% similarity]
drivers/block/drbd/drbd_int.h
include/linux/drbd_genl_api.h
include/uapi/linux/drbd.h [moved from include/linux/drbd.h with 87% similarity]
include/uapi/linux/drbd_limits.h [moved from include/linux/drbd_limits.h with 99% similarity]

index cb1aa66d7d5d9a9b07d5c099486a4844d30ef82e..cd0389488f63e1a70b7ba625aad2bbdc7bcae15e 100644 (file)
@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
-#include <linux/drbd_config.h>
+#include "drbd_config.h"
 #include <linux/module.h>
 
 const char *drbd_buildtag(void)
index f6d6276974eeff4d7e78c680d54dfed79000cc7f..f3d746a6d6fd573eff18ee467fe90500ebb54ba0 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/prefetch.h>
 #include <linux/drbd_genl_api.h>
 #include <linux/drbd.h>
-#include <linux/drbd_config.h>
+#include "drbd_config.h"
 #include "drbd_strings.h"
 #include "drbd_state.h"
 #include "drbd_protocol.h"
index 70682c0580270ab81a51f150e11c8031dadf61e6..19d2639248527966ea8c89d8c143569fd1f9ea45 100644 (file)
@@ -2,46 +2,6 @@
 #ifndef DRBD_GENL_STRUCT_H
 #define DRBD_GENL_STRUCT_H
 
-/**
- * struct drbd_genlmsghdr - DRBD specific header used in NETLINK_GENERIC requests
- * @minor:
- *     For admin requests (user -> kernel): which minor device to operate on.
- *     For (unicast) replies or informational (broadcast) messages
- *     (kernel -> user): which minor device the information is about.
- *     If we do not operate on minors, but on connections or resources,
- *     the minor value shall be (~0), and the attribute DRBD_NLA_CFG_CONTEXT
- *     is used instead.
- * @flags: possible operation modifiers (relevant only for user->kernel):
- *     DRBD_GENL_F_SET_DEFAULTS
- * @volume:
- *     When creating a new minor (adding it to a resource), the resource needs
- *     to know which volume number within the resource this is supposed to be.
- *     The volume number corresponds to the same volume number on the remote side,
- *     whereas the minor number on the remote side may be different
- *     (union with flags).
- * @ret_code: kernel->userland unicast cfg reply return code (union with flags);
- */
-struct drbd_genlmsghdr {
-       __u32 minor;
-       union {
-       __u32 flags;
-       __s32 ret_code;
-       };
-};
-
-/* To be used in drbd_genlmsghdr.flags */
-enum {
-       DRBD_GENL_F_SET_DEFAULTS = 1,
-};
-
-enum drbd_state_info_bcast_reason {
-       SIB_GET_STATUS_REPLY = 1,
-       SIB_STATE_CHANGE = 2,
-       SIB_HELPER_PRE = 3,
-       SIB_HELPER_POST = 4,
-       SIB_SYNC_PROGRESS = 5,
-};
-
 /* hack around predefined gcc/cpp "linux=1",
  * we cannot possibly include <1/drbd_genl.h> */
 #undef linux
similarity index 87%
rename from include/linux/drbd.h
rename to include/uapi/linux/drbd.h
index 5468a2399d483dd46adbe4fa8300ee74cf601f46..7930a972d8a467ae666e850a7b61793d313fab68 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
 /*
   drbd.h
   Kernel module for 2.6.x Kernels
@@ -389,4 +389,44 @@ enum write_ordering_e {
 
 #define DRBD_CPU_MASK_SIZE 32
 
+/**
+ * struct drbd_genlmsghdr - DRBD specific header used in NETLINK_GENERIC requests
+ * @minor:
+ *     For admin requests (user -> kernel): which minor device to operate on.
+ *     For (unicast) replies or informational (broadcast) messages
+ *     (kernel -> user): which minor device the information is about.
+ *     If we do not operate on minors, but on connections or resources,
+ *     the minor value shall be (~0), and the attribute DRBD_NLA_CFG_CONTEXT
+ *     is used instead.
+ * @flags: possible operation modifiers (relevant only for user->kernel):
+ *     DRBD_GENL_F_SET_DEFAULTS
+ * @volume:
+ *     When creating a new minor (adding it to a resource), the resource needs
+ *     to know which volume number within the resource this is supposed to be.
+ *     The volume number corresponds to the same volume number on the remote side,
+ *     whereas the minor number on the remote side may be different
+ *     (union with flags).
+ * @ret_code: kernel->userland unicast cfg reply return code (union with flags);
+ */
+struct drbd_genlmsghdr {
+       __u32 minor;
+       union {
+               __u32 flags;
+               __s32 ret_code;
+       };
+};
+
+/* To be used in drbd_genlmsghdr.flags */
+enum {
+       DRBD_GENL_F_SET_DEFAULTS = 1,
+};
+
+enum drbd_state_info_bcast_reason {
+       SIB_GET_STATUS_REPLY = 1,
+       SIB_STATE_CHANGE = 2,
+       SIB_HELPER_PRE = 3,
+       SIB_HELPER_POST = 4,
+       SIB_SYNC_PROGRESS = 5,
+};
+
 #endif
similarity index 99%
rename from include/linux/drbd_limits.h
rename to include/uapi/linux/drbd_limits.h
index 5b042fb427e978dee94f8e73a87abf640ccd5251..a72a102d1ca7ce846d5dc1fce2a193f641c88b8b 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
 /*
   drbd_limits.h
   This file is part of DRBD by Philipp Reisner and Lars Ellenberg.