Blame SOURCES/daxctl-remove-migrate-device-model.patch

2c7ab9
diff -uprN ndctl-65.orig/Documentation/daxctl/Makefile.am ndctl-65/Documentation/daxctl/Makefile.am
2c7ab9
--- ndctl-65.orig/Documentation/daxctl/Makefile.am	2019-07-29 14:41:44.474017128 -0400
2c7ab9
+++ ndctl-65/Documentation/daxctl/Makefile.am	2019-07-29 14:53:17.934283220 -0400
2c7ab9
@@ -27,8 +27,7 @@ endif
2c7ab9
 
2c7ab9
 man1_MANS = \
2c7ab9
 	daxctl.1 \
2c7ab9
-	daxctl-list.1 \
2c7ab9
-	daxctl-migrate-device-model.1
2c7ab9
+	daxctl-list.1
2c7ab9
 
2c7ab9
 CLEANFILES = $(man1_MANS)
2c7ab9
 
2c7ab9
diff -uprN ndctl-65.orig/Documentation/daxctl/daxctl-migrate-device-model.txt ndctl-65/Documentation/daxctl/daxctl-migrate-device-model.txt
2c7ab9
--- ndctl-65.orig/Documentation/daxctl/daxctl-migrate-device-model.txt	2019-07-29 14:41:44.473017124 -0400
2c7ab9
+++ ndctl-65/Documentation/daxctl/daxctl-migrate-device-model.txt	1969-12-31 19:00:00.000000000 -0500
2c7ab9
@@ -1,47 +0,0 @@
2c7ab9
-// SPDX-License-Identifier: GPL-2.0
2c7ab9
-
2c7ab9
-daxctl-migrate-device-model(1)
2c7ab9
-==============================
2c7ab9
-
2c7ab9
-NAME
2c7ab9
-----
2c7ab9
-daxctl-migrate-device-model - Opt-in to the /sys/bus/dax device-model,
2c7ab9
-allow for alternative Device-DAX instance drivers.
2c7ab9
-
2c7ab9
-SYNOPSIS
2c7ab9
---------
2c7ab9
-[verse]
2c7ab9
-'daxctl migrate-device-model'
2c7ab9
-
2c7ab9
-Arrange for modprobe to disable the dax_pmem_compat, if present, and
2c7ab9
-instead deploy the dax_pmem module to convert to the /sys/bus/dax model.
2c7ab9
-Kernel versions prior to v5.1 may not support /sys/bus/dax in which case
2c7ab9
-the result of this command is a nop until the kernel is updated.  The
2c7ab9
-motivation for changing from /sys/class/dax to /sys/bus/dax is to allow
2c7ab9
-for alternative drivers for Device-DAX instances, in particular the
2c7ab9
-dax_kmem driver.
2c7ab9
-
2c7ab9
-By default device-dax publishes a /dev/daxX.Y character device for
2c7ab9
-userspace to directly map performance differentiated memory. This is
2c7ab9
-fine if the memory is to be exclusively consumed / managed by userspace.
2c7ab9
-Alternatively an administrator may want the kernel to manage the memory,
2c7ab9
-make it available via malloc(), allow for over-provisioning, and / or
2c7ab9
-apply kernel-based resource control schemes to the memory. In that case
2c7ab9
-the memory fronted by a given Device-DAX instance can be assigned to the
2c7ab9
-dax_kmem driver which arranges for the core-kernel memory-management
2c7ab9
-sub-system to assume management of the memory range.
2c7ab9
-
2c7ab9
-This behavior is opt-in for consideration of existing applications /
2c7ab9
-scripts that may be hard coded to use /sys/class/dax. Fixes have been
2c7ab9
-submitted to applications known to have these direct dependencies
2c7ab9
-http://git.kernel.dk/cgit/fio/commit/?id=b08e7d6b18b4[FIO]
2c7ab9
-https://github.com/pmem/pmdk/commit/91bc8620884e[PMDK], however, there may
2c7ab9
-be others and a system-owner should be aware of the potential for
2c7ab9
-regression of Device-DAX consuming scripts, applications, or older
2c7ab9
-daxctl binaries.
2c7ab9
-
2c7ab9
-The modprobe policy established by this utility becomes effective after
2c7ab9
-the next reboot, or after all DAX related modules have been removed and
2c7ab9
-re-loaded with "udevadm trigger"
2c7ab9
-
2c7ab9
-include::../copyright.txt[]
2c7ab9
diff -uprN ndctl-65.orig/daxctl/Makefile.am ndctl-65/daxctl/Makefile.am
2c7ab9
--- ndctl-65.orig/daxctl/Makefile.am	2019-07-29 14:41:44.486017168 -0400
2c7ab9
+++ ndctl-65/daxctl/Makefile.am	2019-07-29 14:53:10.288257995 -0400
2c7ab9
@@ -14,7 +14,6 @@ config.h: $(srcdir)/Makefile.am
2c7ab9
 daxctl_SOURCES =\
2c7ab9
 		daxctl.c \
2c7ab9
 		list.c \
2c7ab9
-		migrate.c \
2c7ab9
 		../util/json.c
2c7ab9
 
2c7ab9
 daxctl_LDADD =\
2c7ab9
diff -uprN ndctl-65.orig/daxctl/builtin.h ndctl-65/daxctl/builtin.h
2c7ab9
--- ndctl-65.orig/daxctl/builtin.h	2019-07-29 14:41:44.486017168 -0400
2c7ab9
+++ ndctl-65/daxctl/builtin.h	2019-07-29 14:53:10.288257995 -0400
2c7ab9
@@ -5,5 +5,4 @@
2c7ab9
 
2c7ab9
 struct daxctl_ctx;
2c7ab9
 int cmd_list(int argc, const char **argv, struct daxctl_ctx *ctx);
2c7ab9
-int cmd_migrate(int argc, const char **argv, struct daxctl_ctx *ctx);
2c7ab9
 #endif /* _DAXCTL_BUILTIN_H_ */
2c7ab9
diff -uprN ndctl-65.orig/daxctl/daxctl.c ndctl-65/daxctl/daxctl.c
2c7ab9
--- ndctl-65.orig/daxctl/daxctl.c	2019-07-29 14:41:44.486017168 -0400
2c7ab9
+++ ndctl-65/daxctl/daxctl.c	2019-07-29 14:53:10.288257995 -0400
2c7ab9
@@ -70,7 +70,6 @@ static struct cmd_struct commands[] = {
2c7ab9
 	{ "version", .d_fn = cmd_version },
2c7ab9
 	{ "list", .d_fn = cmd_list },
2c7ab9
 	{ "help", .d_fn = cmd_help },
2c7ab9
-	{ "migrate-device-model", .d_fn = cmd_migrate },
2c7ab9
 };
2c7ab9
 
2c7ab9
 int main(int argc, const char **argv)
2c7ab9
diff -uprN ndctl-65.orig/daxctl/migrate.c ndctl-65/daxctl/migrate.c
2c7ab9
--- ndctl-65.orig/daxctl/migrate.c	2019-07-29 14:41:44.487017171 -0400
2c7ab9
+++ ndctl-65/daxctl/migrate.c	1969-12-31 19:00:00.000000000 -0500
2c7ab9
@@ -1,41 +0,0 @@
2c7ab9
-/* SPDX-License-Identifier: GPL-2.0 */
2c7ab9
-/* Copyright(c) 2019 Intel Corporation. All rights reserved. */
2c7ab9
-#include <sys/types.h>
2c7ab9
-#include <sys/stat.h>
2c7ab9
-#include <stdio.h>
2c7ab9
-#include <errno.h>
2c7ab9
-#include <fcntl.h>
2c7ab9
-#include <daxctl/config.h>
2c7ab9
-#include <daxctl/libdaxctl.h>
2c7ab9
-#include <util/parse-options.h>
2c7ab9
-#include <ccan/array_size/array_size.h>
2c7ab9
-
2c7ab9
-int cmd_migrate(int argc, const char **argv, struct daxctl_ctx *ctx)
2c7ab9
-{
2c7ab9
-	int i;
2c7ab9
-	static const struct option options[] = {
2c7ab9
-		OPT_END(),
2c7ab9
-	};
2c7ab9
-	const char * const u[] = {
2c7ab9
-		"daxctl migrate-device-model",
2c7ab9
-		NULL
2c7ab9
-	};
2c7ab9
-
2c7ab9
-	argc = parse_options(argc, argv, options, u, 0);
2c7ab9
-	for (i = 0; i < argc; i++)
2c7ab9
-		error("unknown parameter \"%s\"\n", argv[i]);
2c7ab9
-
2c7ab9
-	if (argc)
2c7ab9
-		usage_with_options(u, options);
2c7ab9
-
2c7ab9
-	if (symlink(DAXCTL_MODPROBE_DATA, DAXCTL_MODPROBE_INSTALL) == 0) {
2c7ab9
-		fprintf(stderr, " success: installed %s\n",
2c7ab9
-				DAXCTL_MODPROBE_INSTALL);
2c7ab9
-		return EXIT_SUCCESS;
2c7ab9
-	}
2c7ab9
-
2c7ab9
-	error("failed to install %s: %s\n", DAXCTL_MODPROBE_INSTALL,
2c7ab9
-			strerror(errno));
2c7ab9
-
2c7ab9
-	return EXIT_FAILURE;
2c7ab9
-}