Skip to contentSkip to conversation

kmod: split out umh code into its own file

PATCH New [email protected] 1 participant 1 message Sep 8, 2017 Kernel usermode helper

lore
Share & tools
lore
#0 lore raw

PATCH 110/126 kmod: split out umh code into its own file

From: "Luis R. Rodriguez" <[email protected]>
Subject: kmod: split out umh code into its own file

Patch series "kmod: few code cleanups to split out umh code"

The usermode helper has a provenance from the old usb code which first required a usermode helper. Eventually this was shoved into kmod.c and the kernel's modprobe calls was converted over eventually to share the same code. Over time the list of usermode helpers in the kernel has grown -- so kmod is just but one user of the API.

This series is a simple logical cleanup which acknowledges the code evolution of the usermode helper and shoves the UMH API into its own dedicated file. This way users of the API can later just include umh.h instead of kmod.h.

Note despite the diff state the first patch really is just a code shove, no functional changes are done there. I did use git format-patch -M to generate the patch, but in the end the split was not enough for git to consider it a rename hence the large diffstat.

I've put this through 0-day and it gives me their machine compilation blessings with all tests as OK.

This patch (of 4):

There's a slew of usermode helper users and kmod is just one of them. Split out the usermode helper code into its own file to keep the logic and focus split up.

This change provides no functional changes.

Cc Kees Cook <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Jessica Yu <[email protected]>
Cc Rusty Russell <[email protected]>
Cc Michal Marek <[email protected]>
Cc Petr Mladek <[email protected]>
Cc Miroslav Benes <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Matt Redfearn <[email protected]>
Cc Dan Carpenter <[email protected]>
Cc Colin Ian King <[email protected]>
Cc Daniel Mentz <[email protected]>
Cc David Binderman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---

 MAINTAINERS     |    6 
 kernel/Makefile |    2 
 kernel/kmod.c   |  560 ---------------------------------------------
 kernel/umh.c    |  568 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 577 insertions(+), 559 deletions(-)
MAINTAINERS renamed from MAINTAINERS~kmod-split-out-umh-code-into-its-own-file +6 -0
diff -puN MAINTAINERS~kmod-split-out-umh-code-into-its-own-file MAINTAINERS
@@ -7457,6 +7457,12 @@ S:	Maintained
 F:	tools/testing/selftests/
 F:	Documentation/dev-tools/kselftest*
 
+KERNEL USERMODE HELPER
+M:	"Luis R. Rodriguez" <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	kernel/umh.c
+
 KERNEL VIRTUAL MACHINE (KVM)
 M:	Paolo Bonzini <[email protected]>
 M:	Radim Krčmář <[email protected]>
kernel/Makefile renamed from kernel/Makefile~kmod-split-out-umh-code-into-its-own-file +1 -1
diff -puN kernel/Makefile~kmod-split-out-umh-code-into-its-own-file kernel/Makefile
@@ -5,7 +5,7 @@
 obj-y     = fork.o exec_domain.o panic.o \
 	    cpu.o exit.o softirq.o resource.o \
 	    sysctl.o sysctl_binary.o capability.o ptrace.o user.o \
-	    signal.o sys.o kmod.o workqueue.o pid.o task_work.o \
+	    signal.o sys.o umh.o kmod.o workqueue.o pid.o task_work.o \
 	    extable.o params.o \
 	    kthread.o sys_ni.o nsproxy.o \
 	    notifier.o ksysfs.o cred.o reboot.o \
kernel/kmod.c renamed from kernel/kmod.c~kmod-split-out-umh-code-into-its-own-file +2 -558

573 lines not on this page · raw message

kernel/umh.c new file +568 -0

568 lines not on this page · raw message

_