All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-cxl@vger.kernel.org
Cc: vishal.l.verma@intel.com
Subject: [ndctl PATCH 02/37] ndctl: Rename util_filter to ndctl_filter
Date: Sun, 23 Jan 2022 16:52:00 -0800	[thread overview]
Message-ID: <164298552014.3021641.16369576632179722489.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <164298550885.3021641.11210386002804544864.stgit@dwillia2-desk3.amr.corp.intel.com>

In preparation for introducing a cxl_filter_walk() implementation rename
the current filter_walk infrastructure with an ndctl_ prefix.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/filter.c         |    4 ++--
 ndctl/filter.h         |   21 +++++++++++----------
 ndctl/list.c           |   14 +++++++-------
 ndctl/monitor.c        |   12 ++++++------
 test/list-smart-dimm.c |   12 ++++++------
 5 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/ndctl/filter.c b/ndctl/filter.c
index 64d00ce87dd5..5b810dc5926d 100644
--- a/ndctl/filter.c
+++ b/ndctl/filter.c
@@ -338,8 +338,8 @@ const char *util_nsmode_name(enum ndctl_namespace_mode mode)
 	return modes[mode];
 }
 
-int util_filter_walk(struct ndctl_ctx *ctx, struct util_filter_ctx *fctx,
-		struct util_filter_params *param)
+int ndctl_filter_walk(struct ndctl_ctx *ctx, struct ndctl_filter_ctx *fctx,
+		      struct ndctl_filter_params *param)
 {
 	struct ndctl_bus *bus;
 	unsigned int type = 0;
diff --git a/ndctl/filter.h b/ndctl/filter.h
index 9800cc230865..f6fe325acdc1 100644
--- a/ndctl/filter.h
+++ b/ndctl/filter.h
@@ -31,7 +31,7 @@ const char *util_nsmode_name(enum ndctl_namespace_mode mode);
 
 struct json_object;
 
-/* json object hierarchy for the util_filter_walk() performed by cmd_list() */
+/* json object hierarchy for the ndctl_filter_walk() performed by cmd_list() */
 struct list_filter_arg {
 	struct json_object *jnamespaces;
 	struct json_object *jregions;
@@ -50,19 +50,20 @@ struct monitor_filter_arg {
 };
 
 /*
- * struct util_filter_ctx - control and callbacks for util_filter_walk()
+ * struct ndctl_filter_ctx - control and callbacks for ndctl_filter_walk()
  * ->filter_bus() and ->filter_region() return bool because the
  * child-object filter routines can not be called if the parent context
  * is not established. ->filter_dimm() and ->filter_namespace() are leaf
  * objects, so no child dependencies to check.
  */
-struct util_filter_ctx {
-	bool (*filter_bus)(struct ndctl_bus *bus, struct util_filter_ctx *ctx);
-	void (*filter_dimm)(struct ndctl_dimm *dimm, struct util_filter_ctx *ctx);
+struct ndctl_filter_ctx {
+	bool (*filter_bus)(struct ndctl_bus *bus, struct ndctl_filter_ctx *ctx);
+	void (*filter_dimm)(struct ndctl_dimm *dimm,
+			    struct ndctl_filter_ctx *ctx);
 	bool (*filter_region)(struct ndctl_region *region,
-			struct util_filter_ctx *ctx);
+			      struct ndctl_filter_ctx *ctx);
 	void (*filter_namespace)(struct ndctl_namespace *ndns,
-			struct util_filter_ctx *ctx);
+				 struct ndctl_filter_ctx *ctx);
 	union {
 		void *arg;
 		struct list_filter_arg *list;
@@ -70,7 +71,7 @@ struct util_filter_ctx {
 	};
 };
 
-struct util_filter_params {
+struct ndctl_filter_params {
 	const char *bus;
 	const char *region;
 	const char *type;
@@ -81,6 +82,6 @@ struct util_filter_params {
 };
 
 struct ndctl_ctx;
-int util_filter_walk(struct ndctl_ctx *ctx, struct util_filter_ctx *fctx,
-		struct util_filter_params *param);
+int ndctl_filter_walk(struct ndctl_ctx *ctx, struct ndctl_filter_ctx *fctx,
+		      struct ndctl_filter_params *param);
 #endif /* _NDCTL_UTIL_FILTER_H_ */
diff --git a/ndctl/list.c b/ndctl/list.c
index 869edde4fc65..d89801946a0d 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -55,7 +55,7 @@ static unsigned long listopts_to_flags(void)
 	return flags;
 }
 
-static struct util_filter_params param;
+static struct ndctl_filter_params param;
 
 static int did_fail;
 
@@ -234,7 +234,7 @@ static struct json_object *region_to_json(struct ndctl_region *region,
 }
 
 static void filter_namespace(struct ndctl_namespace *ndns,
-		struct util_filter_ctx *ctx)
+			     struct ndctl_filter_ctx *ctx)
 {
 	struct json_object *jndns;
 	struct list_filter_arg *lfa = ctx->list;
@@ -272,7 +272,7 @@ static void filter_namespace(struct ndctl_namespace *ndns,
 }
 
 static bool filter_region(struct ndctl_region *region,
-		struct util_filter_ctx *ctx)
+			  struct ndctl_filter_ctx *ctx)
 {
 	struct list_filter_arg *lfa = ctx->list;
 	struct json_object *jbus = lfa->jbus;
@@ -318,7 +318,7 @@ static bool filter_region(struct ndctl_region *region,
 	return true;
 }
 
-static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *ctx)
+static void filter_dimm(struct ndctl_dimm *dimm, struct ndctl_filter_ctx *ctx)
 {
 	struct list_filter_arg *lfa = ctx->list;
 	struct json_object *jdimm;
@@ -367,7 +367,7 @@ static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *ctx)
 	json_object_array_add(lfa->jdimms, jdimm);
 }
 
-static bool filter_bus(struct ndctl_bus *bus, struct util_filter_ctx *ctx)
+static bool filter_bus(struct ndctl_bus *bus, struct ndctl_filter_ctx *ctx)
 {
 	struct list_filter_arg *lfa = ctx->list;
 
@@ -489,7 +489,7 @@ int cmd_list(int argc, const char **argv, struct ndctl_ctx *ctx)
 		NULL
 	};
 	bool lint = !!secure_getenv("NDCTL_LIST_LINT");
-	struct util_filter_ctx fctx = { 0 };
+	struct ndctl_filter_ctx fctx = { 0 };
 	struct list_filter_arg lfa = { 0 };
 	int i, rc;
 
@@ -544,7 +544,7 @@ int cmd_list(int argc, const char **argv, struct ndctl_ctx *ctx)
 	fctx.list = &lfa;
 	lfa.flags = listopts_to_flags();
 
-	rc = util_filter_walk(ctx, &fctx, &param);
+	rc = ndctl_filter_walk(ctx, &fctx, &param);
 	if (rc)
 		return rc;
 
diff --git a/ndctl/monitor.c b/ndctl/monitor.c
index ae694c614593..3e6a42527088 100644
--- a/ndctl/monitor.c
+++ b/ndctl/monitor.c
@@ -49,7 +49,7 @@ struct monitor_dimm {
 	struct list_node list;
 };
 
-static struct util_filter_params param;
+static struct ndctl_filter_params param;
 
 static int did_fail;
 
@@ -264,12 +264,12 @@ out:
 }
 
 static bool filter_region(struct ndctl_region *region,
-		struct util_filter_ctx *fctx)
+			  struct ndctl_filter_ctx *fctx)
 {
 	return true;
 }
 
-static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *fctx)
+static void filter_dimm(struct ndctl_dimm *dimm, struct ndctl_filter_ctx *fctx)
 {
 	struct monitor_dimm *mdimm;
 	struct monitor_filter_arg *mfa = fctx->monitor;
@@ -317,7 +317,7 @@ static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *fctx)
 	return;
 }
 
-static bool filter_bus(struct ndctl_bus *bus, struct util_filter_ctx *fctx)
+static bool filter_bus(struct ndctl_bus *bus, struct ndctl_filter_ctx *fctx)
 {
 	return true;
 }
@@ -602,7 +602,7 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx)
 		CONF_END(),
 	};
 	const char *prefix = "./", *ndctl_configs;
-	struct util_filter_ctx fctx = { 0 };
+	struct ndctl_filter_ctx fctx = { 0 };
 	struct monitor_filter_arg mfa = { 0 };
 	int i, rc;
 
@@ -672,7 +672,7 @@ int cmd_monitor(int argc, const char **argv, struct ndctl_ctx *ctx)
 	mfa.maxfd_dimm = -1;
 	mfa.flags = 0;
 
-	rc = util_filter_walk(ctx, &fctx, &param);
+	rc = ndctl_filter_walk(ctx, &fctx, &param);
 	if (rc)
 		goto out;
 
diff --git a/test/list-smart-dimm.c b/test/list-smart-dimm.c
index 47b711e63670..f94277e8febd 100644
--- a/test/list-smart-dimm.c
+++ b/test/list-smart-dimm.c
@@ -11,7 +11,7 @@
 #include <ndctl/ndctl.h>
 #include <ndctl/json.h>
 
-struct util_filter_params param;
+struct ndctl_filter_params param;
 static int did_fail;
 static int jflag = JSON_C_TO_STRING_PRETTY;
 
@@ -23,12 +23,12 @@ do { \
 } while (0)
 
 static bool filter_region(struct ndctl_region *region,
-		struct util_filter_ctx *ctx)
+		struct ndctl_filter_ctx *ctx)
 {
 	return true;
 }
 
-static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *ctx)
+static void filter_dimm(struct ndctl_dimm *dimm, struct ndctl_filter_ctx *ctx)
 {
 	struct list_filter_arg *lfa = ctx->list;
 	struct json_object *jdimm;
@@ -57,7 +57,7 @@ static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *ctx)
 	json_object_array_add(lfa->jdimms, jdimm);
 }
 
-static bool filter_bus(struct ndctl_bus *bus, struct util_filter_ctx *ctx)
+static bool filter_bus(struct ndctl_bus *bus, struct ndctl_filter_ctx *ctx)
 {
 	return true;
 }
@@ -89,7 +89,7 @@ int main(int argc, const char *argv[])
 		"list-smart-dimm [<options>]",
 		NULL
 	};
-	struct util_filter_ctx fctx = { 0 };
+	struct ndctl_filter_ctx fctx = { 0 };
 	struct list_filter_arg lfa = { 0 };
 
 	rc = ndctl_new(&ctx);
@@ -108,7 +108,7 @@ int main(int argc, const char *argv[])
 	fctx.list = &lfa;
 	lfa.flags = 0;
 
-	rc = util_filter_walk(ctx, &fctx, &param);
+	rc = ndctl_filter_walk(ctx, &fctx, &param);
 	if (rc)
 		return rc;
 


  parent reply	other threads:[~2022-01-24  0:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  0:51 [ndctl PATCH 00/37] cxl: Full topology enumeration Dan Williams
2022-01-24  0:51 ` [ndctl PATCH 01/37] test: Add 'suite' identifiers to tests Dan Williams
2022-01-24  0:52 ` Dan Williams [this message]
2022-01-24  0:52 ` [ndctl PATCH 03/37] build: Add tags Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 04/37] json: Add support for json_object_new_uint64() Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 05/37] cxl/json: Cleanup object leak false positive Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 06/37] cxl/list: Support multiple memdev device name filter arguments Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 07/37] cxl/list: Support comma separated lists Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 08/37] cxl/list: Introduce cxl_filter_walk() Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 09/37] cxl/list: Emit device serial numbers Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 10/37] cxl/list: Add filter by serial support Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 11/37] cxl/lib: Rename nvdimm bridge to pmem Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 12/37] cxl/list: Cleanup options definitions Dan Williams
2022-01-24  0:52 ` [ndctl PATCH 13/37] Documentation: Enhance libcxl memdev API documentation Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 14/37] cxl/list: Add bus objects Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 15/37] util/json: Warn on stderr about empty list results Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 16/37] util/sysfs: Uplevel modalias lookup helper to util/ Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 17/37] cxl/list: Add port enumeration Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 18/37] cxl/list: Add --debug option Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 19/37] cxl/list: Add endpoints Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 20/37] cxl/list: Add 'host' entries for port-like objects Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 21/37] cxl/list: Add 'host' entries for memdevs Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 22/37] cxl/list: Move enabled memdevs underneath their endpoint Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 23/37] cxl/list: Filter memdev by ancestry Dan Williams
2022-01-24  0:53 ` [ndctl PATCH 24/37] cxl/memdev: Use a local logger for debug Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 25/37] cxl/memdev: Cleanup memdev filter Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 26/37] cxl/memdev: Add serial support for memdev-related commands Dan Williams
2022-02-10  1:10   ` Alison Schofield
2022-02-10  1:55     ` Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 27/37] cxl/list: Add 'numa_node' to memdev listings Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 28/37] util: Implement common bind/unbind helpers Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 29/37] cxl/memdev: Enable / disable support Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 30/37] cxl/list: Add decoder support Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 31/37] cxl/list: Extend decoder objects with target information Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 32/37] cxl/list: Use 'physical_node' for root port attachment detection Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 33/37] cxl/list: Reuse the --target option for ports Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 34/37] cxl/list: Support filtering memdevs by decoders Dan Williams
2022-01-24  0:54 ` [ndctl PATCH 35/37] cxl/list: Support filtering memdevs by ports Dan Williams
2022-01-24  0:55 ` [ndctl PATCH 36/37] cxl/port: Add {disable,enable}-port command Dan Williams
2022-01-24  0:55 ` [ndctl PATCH 37/37] cxl/list: Filter dports and targets by memdevs Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164298552014.3021641.16369576632179722489.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.