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

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