Blame nvme-cli-2.5-nbft-make-lookup_ctrl-function-public.patch

Tomas Bzatek 986ba7
From 34c197e0ac2d57734ab775f00b2d0758aca7b82f Mon Sep 17 00:00:00 2001
Tomas Bzatek 986ba7
From: John Meneghini <jmeneghi@redhat.com>
Tomas Bzatek 986ba7
Date: Fri, 14 Apr 2023 10:53:58 -0400
Tomas Bzatek 986ba7
Subject: [PATCH 01/11] nbft: make lookup_ctrl function public
Tomas Bzatek 986ba7
Tomas Bzatek 986ba7
To prepare for the addition of nbft functionality fixup the fabrics
Tomas Bzatek 986ba7
declarations.
Tomas Bzatek 986ba7
Tomas Bzatek 986ba7
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Tomas Bzatek 986ba7
---
Tomas Bzatek 986ba7
 fabrics.c | 12 ++----------
Tomas Bzatek 986ba7
 fabrics.h | 10 ++++++++++
Tomas Bzatek 986ba7
 2 files changed, 12 insertions(+), 10 deletions(-)
Tomas Bzatek 986ba7
Tomas Bzatek 986ba7
diff --git a/fabrics.c b/fabrics.c
Tomas Bzatek 986ba7
index f8078e59..80827b16 100644
Tomas Bzatek 986ba7
--- a/fabrics.c
Tomas Bzatek 986ba7
+++ b/fabrics.c
Tomas Bzatek 986ba7
@@ -43,6 +43,7 @@
Tomas Bzatek 986ba7
 #include "libnvme.h"
Tomas Bzatek 986ba7
 #include "nvme-print.h"
Tomas Bzatek 986ba7
 #include "nvme-print-json.h"
Tomas Bzatek 986ba7
+#include "fabrics.h"
Tomas Bzatek 986ba7
 
Tomas Bzatek 986ba7
 #define PATH_NVMF_DISC		SYSCONFDIR "/nvme/discovery.conf"
Tomas Bzatek 986ba7
 #define PATH_NVMF_CONFIG	SYSCONFDIR "/nvme/config.json"
Tomas Bzatek 986ba7
@@ -110,15 +111,6 @@ static const char *nvmf_config_file	= "Use specified JSON configuration file or
Tomas Bzatek 986ba7
 	OPT_FLAG("data-digest",       'G', &c.data_digest,        nvmf_data_digest), \
Tomas Bzatek 986ba7
 	OPT_FLAG("tls",                 0, &c.tls,                nvmf_tls)	\
Tomas Bzatek 986ba7
 
Tomas Bzatek 986ba7
-struct tr_config {
Tomas Bzatek 986ba7
-	const char *subsysnqn;
Tomas Bzatek 986ba7
-	const char *transport;
Tomas Bzatek 986ba7
-	const char *traddr;
Tomas Bzatek 986ba7
-	const char *host_traddr;
Tomas Bzatek 986ba7
-	const char *host_iface;
Tomas Bzatek 986ba7
-	const char *trsvcid;
Tomas Bzatek 986ba7
-};
Tomas Bzatek 986ba7
-
Tomas Bzatek 986ba7
 /*
Tomas Bzatek 986ba7
  * Compare two C strings and handle NULL pointers gracefully.
Tomas Bzatek 986ba7
  * If either of the two strings is NULL, return 0
Tomas Bzatek 986ba7
@@ -202,7 +194,7 @@ static nvme_ctrl_t lookup_discovery_ctrl(nvme_root_t r, struct tr_config *trcfg)
Tomas Bzatek 986ba7
 	return __lookup_ctrl(r, trcfg, disc_ctrl_config_match);
Tomas Bzatek 986ba7
 }
Tomas Bzatek 986ba7
 
Tomas Bzatek 986ba7
-static nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg)
Tomas Bzatek 986ba7
+nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg)
Tomas Bzatek 986ba7
 {
Tomas Bzatek 986ba7
 	return __lookup_ctrl(r, trcfg, ctrl_config_match);
Tomas Bzatek 986ba7
 }
Tomas Bzatek 986ba7
diff --git a/fabrics.h b/fabrics.h
Tomas Bzatek 986ba7
index d1e16fc5..02cebf5d 100644
Tomas Bzatek 986ba7
--- a/fabrics.h
Tomas Bzatek 986ba7
+++ b/fabrics.h
Tomas Bzatek 986ba7
@@ -2,6 +2,16 @@
Tomas Bzatek 986ba7
 #ifndef _FABRICS_H
Tomas Bzatek 986ba7
 #define _FABRICS_H
Tomas Bzatek 986ba7
 
Tomas Bzatek 986ba7
+struct tr_config {
Tomas Bzatek 986ba7
+	const char *subsysnqn;
Tomas Bzatek 986ba7
+	const char *transport;
Tomas Bzatek 986ba7
+	const char *traddr;
Tomas Bzatek 986ba7
+	const char *host_traddr;
Tomas Bzatek 986ba7
+	const char *host_iface;
Tomas Bzatek 986ba7
+	const char *trsvcid;
Tomas Bzatek 986ba7
+};
Tomas Bzatek 986ba7
+
Tomas Bzatek 986ba7
+extern nvme_ctrl_t lookup_ctrl(nvme_root_t r, struct tr_config *trcfg);
Tomas Bzatek 986ba7
 extern int nvmf_discover(const char *desc, int argc, char **argv, bool connect);
Tomas Bzatek 986ba7
 extern int nvmf_connect(const char *desc, int argc, char **argv);
Tomas Bzatek 986ba7
 extern int nvmf_disconnect(const char *desc, int argc, char **argv);
Tomas Bzatek 986ba7
-- 
Tomas Bzatek 986ba7
2.39.2
Tomas Bzatek 986ba7