Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cscope.*
compile_commands.json

.build
.build-tools
.cache
.vscode/

Expand Down
6 changes: 3 additions & 3 deletions src/libnvme-mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
extern "C" {
#endif

#include "nvme/types.h"
#include "nvme/mi.h"
#include "nvme/log.h"
#include <nvme/types.h>
#include <nvme/mi.h>
#include <nvme/log.h>

#ifdef __cplusplus
}
Expand Down
18 changes: 9 additions & 9 deletions src/libnvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
extern "C" {
#endif

#include "nvme/types.h"
#include "nvme/linux.h"
#include "nvme/ioctl.h"
#include "nvme/nbft.h"
#include "nvme/fabrics.h"
#include "nvme/filters.h"
#include "nvme/tree.h"
#include "nvme/util.h"
#include "nvme/log.h"
#include <nvme/types.h>
#include <nvme/linux.h>
#include <nvme/ioctl.h>
#include <nvme/nbft.h>
#include <nvme/fabrics.h>
#include <nvme/filters.h>
#include <nvme/tree.h>
#include <nvme/util.h>
#include <nvme/log.h>

#ifdef __cplusplus
}
Expand Down
3 changes: 2 additions & 1 deletion src/nvme/api-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#define _LIBNVME_API_TYPES_H

#include <stdbool.h>
#include "types.h"

#include <nvme/types.h>

/*
* _args struct definitions. These are used by both the ioctl-based and
Expand Down
3 changes: 2 additions & 1 deletion src/nvme/fabrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

#include <stdbool.h>
#include <stdint.h>
#include "tree.h"

#include <nvme/tree.h>

/**
* DOC: fabrics.h
Expand Down
3 changes: 2 additions & 1 deletion src/nvme/filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#define _LIBNVME_FILTERS_H

#include <dirent.h>
#include "tree.h"

#include <nvme/tree.h>

/**
* DOC: filters.h
Expand Down
5 changes: 3 additions & 2 deletions src/nvme/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

#include <stddef.h>
#include <sys/ioctl.h>
#include "types.h"
#include "api-types.h"

#include <nvme/types.h>
#include <nvme/api-types.h>

/*
* We can not always count on the kernel UAPI being installed. Use the same
Expand Down
4 changes: 2 additions & 2 deletions src/nvme/linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#include <stddef.h>

#include "ioctl.h"
#include "types.h"
#include <nvme/ioctl.h>
#include <nvme/types.h>

/**
* DOC: linux.h
Expand Down
2 changes: 1 addition & 1 deletion src/nvme/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <syslog.h>

/* for nvme_root_t */
#include "tree.h"
#include <nvme/tree.h>

#ifndef MAX_LOGLEVEL
# define MAX_LOGLEVEL LOG_DEBUG
Expand Down
4 changes: 2 additions & 2 deletions src/nvme/mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
#include <endian.h>
#include <stdint.h>

#include "types.h"
#include "tree.h"
#include <nvme/types.h>
#include <nvme/tree.h>

/**
* NVME_MI_MSGTYPE_NVME - MCTP message type for NVMe-MI messages.
Expand Down
3 changes: 2 additions & 1 deletion src/nvme/nbft.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#define _NBFT_H

#include <sys/types.h>
#include "util.h"

#include <nvme/util.h>

/**
* DOC: nbft.h
Expand Down
5 changes: 2 additions & 3 deletions src/nvme/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
#include <poll.h>
#include <sys/socket.h>

#include "fabrics.h"
#include "mi.h"

#include <nvme/fabrics.h>
#include <nvme/mi.h>

const char *nvme_subsys_sysfs_dir(void);
const char *nvme_ctrl_sysfs_dir(void);
Expand Down
4 changes: 2 additions & 2 deletions src/nvme/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <sys/types.h>
#include <netinet/in.h>

#include "ioctl.h"
#include "util.h"
#include <nvme/ioctl.h>
#include <nvme/util.h>

/**
* DOC: tree.h
Expand Down
2 changes: 1 addition & 1 deletion src/nvme/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <ifaddrs.h>

#include "types.h"
#include <nvme/types.h>

/**
* DOC: util.h
Expand Down
1 change: 1 addition & 0 deletions test/cpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include <iostream>

#include <libnvme.h>

int main()
Expand Down
5 changes: 3 additions & 2 deletions test/ioctl/ana.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-License-Identifier: LGPL-2.1-or-later

#include <libnvme.h>

#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>

#include <ccan/array_size/array_size.h>
#include <ccan/endian/endian.h>

#include <libnvme.h>

#include "mock.h"
#include "util.h"

Expand Down
7 changes: 4 additions & 3 deletions test/ioctl/discovery.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-License-Identifier: LGPL-2.1-or-later

#include <libnvme.h>

#include <errno.h>
#include <stdlib.h>
#include <string.h>

#include <ccan/array_size/array_size.h>
#include <ccan/endian/endian.h>

#include "../../src/nvme/private.h"
#include <libnvme.h>
#include <nvme/private.h>

#include "mock.h"
#include "util.h"

Expand Down
4 changes: 2 additions & 2 deletions test/ioctl/features.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: LGPL-2.1-or-later

#include <libnvme.h>

#include <errno.h>
#include <inttypes.h>

#include <libnvme.h>

#include "mock.h"
#include "util.h"

Expand Down
4 changes: 2 additions & 2 deletions test/ioctl/identify.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: LGPL-2.1-or-later

#include <libnvme.h>

#include <errno.h>
#include <stdlib.h>

#include <libnvme.h>

#include "mock.h"
#include "util.h"

Expand Down
1 change: 1 addition & 0 deletions test/ioctl/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mock_conf.set(
mock_ioctl = library(
'mock-ioctl',
['mock.c', 'util.c'],
include_directories: [incdir, internal_incdir],
dependencies: [dl_dep],
c_args: ['-DHAVE_GLIBC_IOCTL=' + (mock_conf.get('HAVE_GLIBC_IOCTL') ? '1' : '0')])

Expand Down
6 changes: 3 additions & 3 deletions test/ioctl/mock.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// SPDX-License-Identifier: LGPL-2.1-or-later

#include "mock.h"

#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <string.h>
#include <sys/ioctl.h>
#include <dlfcn.h>

#include "../../src/nvme/ioctl.h"
#include <nvme/ioctl.h>

#include "mock.h"
#include "util.h"

struct mock_cmds {
Expand Down
4 changes: 2 additions & 2 deletions test/ioctl/util.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: LGPL-2.1-or-later

#include "util.h"

#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "util.h"

static void hexdump(const uint8_t *buf, size_t len)
{
size_t i = 0;
Expand Down