Skip to content

Commit c8ac160

Browse files
chrboekawasaki
authored andcommitted
drbd: move UAPI headers to include/uapi/linux/
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>
1 parent 59ca59b commit c8ac160

6 files changed

Lines changed: 44 additions & 44 deletions

File tree

drivers/block/drbd/drbd_buildtag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0-only
2-
#include <linux/drbd_config.h>
2+
#include "drbd_config.h"
33
#include <linux/module.h>
44

55
const char *drbd_buildtag(void)

drivers/block/drbd/drbd_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <linux/prefetch.h>
3535
#include <linux/drbd_genl_api.h>
3636
#include <linux/drbd.h>
37-
#include <linux/drbd_config.h>
37+
#include "drbd_config.h"
3838
#include "drbd_strings.h"
3939
#include "drbd_state.h"
4040
#include "drbd_protocol.h"

include/linux/drbd_genl_api.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,6 @@
22
#ifndef DRBD_GENL_STRUCT_H
33
#define DRBD_GENL_STRUCT_H
44

5-
/**
6-
* struct drbd_genlmsghdr - DRBD specific header used in NETLINK_GENERIC requests
7-
* @minor:
8-
* For admin requests (user -> kernel): which minor device to operate on.
9-
* For (unicast) replies or informational (broadcast) messages
10-
* (kernel -> user): which minor device the information is about.
11-
* If we do not operate on minors, but on connections or resources,
12-
* the minor value shall be (~0), and the attribute DRBD_NLA_CFG_CONTEXT
13-
* is used instead.
14-
* @flags: possible operation modifiers (relevant only for user->kernel):
15-
* DRBD_GENL_F_SET_DEFAULTS
16-
* @volume:
17-
* When creating a new minor (adding it to a resource), the resource needs
18-
* to know which volume number within the resource this is supposed to be.
19-
* The volume number corresponds to the same volume number on the remote side,
20-
* whereas the minor number on the remote side may be different
21-
* (union with flags).
22-
* @ret_code: kernel->userland unicast cfg reply return code (union with flags);
23-
*/
24-
struct drbd_genlmsghdr {
25-
__u32 minor;
26-
union {
27-
__u32 flags;
28-
__s32 ret_code;
29-
};
30-
};
31-
32-
/* To be used in drbd_genlmsghdr.flags */
33-
enum {
34-
DRBD_GENL_F_SET_DEFAULTS = 1,
35-
};
36-
37-
enum drbd_state_info_bcast_reason {
38-
SIB_GET_STATUS_REPLY = 1,
39-
SIB_STATE_CHANGE = 2,
40-
SIB_HELPER_PRE = 3,
41-
SIB_HELPER_POST = 4,
42-
SIB_SYNC_PROGRESS = 5,
43-
};
44-
455
/* hack around predefined gcc/cpp "linux=1",
466
* we cannot possibly include <1/drbd_genl.h> */
477
#undef linux
Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0-or-later */
1+
/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
22
/*
33
drbd.h
44
Kernel module for 2.6.x Kernels
@@ -389,4 +389,44 @@ enum write_ordering_e {
389389

390390
#define DRBD_CPU_MASK_SIZE 32
391391

392+
/**
393+
* struct drbd_genlmsghdr - DRBD specific header used in NETLINK_GENERIC requests
394+
* @minor:
395+
* For admin requests (user -> kernel): which minor device to operate on.
396+
* For (unicast) replies or informational (broadcast) messages
397+
* (kernel -> user): which minor device the information is about.
398+
* If we do not operate on minors, but on connections or resources,
399+
* the minor value shall be (~0), and the attribute DRBD_NLA_CFG_CONTEXT
400+
* is used instead.
401+
* @flags: possible operation modifiers (relevant only for user->kernel):
402+
* DRBD_GENL_F_SET_DEFAULTS
403+
* @volume:
404+
* When creating a new minor (adding it to a resource), the resource needs
405+
* to know which volume number within the resource this is supposed to be.
406+
* The volume number corresponds to the same volume number on the remote side,
407+
* whereas the minor number on the remote side may be different
408+
* (union with flags).
409+
* @ret_code: kernel->userland unicast cfg reply return code (union with flags);
410+
*/
411+
struct drbd_genlmsghdr {
412+
__u32 minor;
413+
union {
414+
__u32 flags;
415+
__s32 ret_code;
416+
};
417+
};
418+
419+
/* To be used in drbd_genlmsghdr.flags */
420+
enum {
421+
DRBD_GENL_F_SET_DEFAULTS = 1,
422+
};
423+
424+
enum drbd_state_info_bcast_reason {
425+
SIB_GET_STATUS_REPLY = 1,
426+
SIB_STATE_CHANGE = 2,
427+
SIB_HELPER_PRE = 3,
428+
SIB_HELPER_POST = 4,
429+
SIB_SYNC_PROGRESS = 5,
430+
};
431+
392432
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* SPDX-License-Identifier: GPL-2.0-only */
1+
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
22
/*
33
drbd_limits.h
44
This file is part of DRBD by Philipp Reisner and Lars Ellenberg.

0 commit comments

Comments
 (0)