File: nvme-lib.h

package info (click to toggle)
multipath-tools 0.14.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,088 kB
  • sloc: ansic: 64,885; perl: 1,622; makefile: 742; sh: 732; pascal: 155
file content (39 lines) | stat: -rw-r--r-- 1,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef NVME_LIB_H_INCLUDED
#define NVME_LIB_H_INCLUDED

#include "nvme.h"

int log_nvme_errcode(int err, const char *dev, const char *msg);
int libmp_nvme_get_nsid(int fd);
int libmp_nvme_identify_ctrl(int fd, struct nvme_id_ctrl *ctrl);
int libmp_nvme_identify_ns(int fd, __u32 nsid, bool present,
			   struct nvme_id_ns *ns);
int libmp_nvme_ana_log(int fd, void *ana_log, size_t ana_log_len, int rgo);
/*
 * Identify controller, and return true if ANA is supported
 * ctrl will be filled in if controller is identified, even w/o ANA
 * ctrl may be NULL
 */
int nvme_id_ctrl_ana(int fd, struct nvme_id_ctrl *ctrl);

#ifndef NVME_LIB_C
/*
 * In all files except nvme-lib.c, the nvme functions can be called
 * by their usual name.
 */
#define nvme_get_nsid libmp_nvme_get_nsid
#define nvme_identify_ctrl libmp_nvme_identify_ctrl
#define nvme_identify_ns libmp_nvme_identify_ns
#define nvme_ana_log libmp_nvme_ana_log
/*
 * Undefine these to avoid clashes with libmultipath's byteorder.h
 */
#undef cpu_to_le16
#undef cpu_to_le32
#undef cpu_to_le64
#undef le16_to_cpu
#undef le32_to_cpu
#undef le64_to_cpu
#endif

#endif /* NVME_LIB_H_INCLUDED */