Skip to content

Commit 7152f5c

Browse files
committed
linux: reduce the number of includes
Forward declare the three data structs and thus avoid to include nvme/ioctl.h and nvme/types.h. This reduces the inter dependencies between the headers and simplifies any porting attempts. Signed-off-by: Daniel Wagner <[email protected]>
1 parent f1daa1e commit 7152f5c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

libnvme/src/nvme/linux.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
* Authors: Keith Busch <[email protected]>
77
* Chaitanya Kulkarni <[email protected]>
88
*/
9-
#ifndef _LIBNVME_LINUX_H
10-
#define _LIBNVME_LINUX_H
9+
#pragma once
1110

1211
#include <stddef.h>
13-
#include <stdio.h>
12+
#include <stdbool.h>
1413

15-
#include <nvme/ioctl.h>
16-
#include <nvme/types.h>
14+
struct nvme_transport_handle;
15+
struct nvme_passthru_cmd;
16+
struct nvme_global_ctx;
1717

1818
/**
1919
* DOC: linux.h
@@ -555,5 +555,3 @@ void nvme_set_dry_run(struct nvme_global_ctx *ctx, bool enable);
555555
* IOCTL probing is enabled per default.
556556
*/
557557
void nvme_set_ioctl_probing(struct nvme_global_ctx *ctx, bool enable);
558-
559-
#endif /* _LIBNVME_LINUX_H */

0 commit comments

Comments
 (0)