Page MenuHomeFreeBSD

D20333.id.diff
No OneTemporary

D20333.id.diff

Index: head/sys/compat/linux/linux.h
===================================================================
--- head/sys/compat/linux/linux.h
+++ head/sys/compat/linux/linux.h
@@ -143,4 +143,7 @@
extern LIST_HEAD(futex_list, futex) futex_list;
extern struct mtx futex_mtx;
+void linux_dev_shm_create(void);
+void linux_dev_shm_destroy(void);
+
#endif /* _LINUX_MI_H_ */
Index: head/sys/compat/linux/linux.c
===================================================================
--- head/sys/compat/linux/linux.c
+++ head/sys/compat/linux/linux.c
@@ -31,6 +31,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/conf.h>
#include <sys/ctype.h>
#include <sys/jail.h>
#include <sys/lock.h>
@@ -129,6 +130,12 @@
SIGSYS /* LINUX_SIGSYS */
};
+static struct cdev *dev_shm_cdev;
+static struct cdevsw dev_shm_cdevsw = {
+ .d_version = D_VERSION,
+ .d_name = "dev_shm",
+};
+
/*
* Map Linux RT signals to the FreeBSD RT signals.
*/
@@ -523,4 +530,24 @@
out:
free(kosa, M_SONAME);
return (error);
+}
+
+void
+linux_dev_shm_create(void)
+{
+ int error;
+
+ error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &dev_shm_cdev,
+ &dev_shm_cdevsw, NULL, UID_ROOT, GID_WHEEL, 0, "shm/.mountpoint");
+ if (error != 0) {
+ printf("%s: failed to create device node, error %d\n",
+ __func__, error);
+ }
+}
+
+void
+linux_dev_shm_destroy(void)
+{
+
+ destroy_dev(dev_shm_cdev);
}
Index: head/sys/compat/linux/linux_common.c
===================================================================
--- head/sys/compat/linux/linux_common.c
+++ head/sys/compat/linux/linux_common.c
@@ -68,6 +68,7 @@
switch(type) {
case MOD_LOAD:
+ linux_dev_shm_create();
linux_osd_jail_register();
linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,
linux_proc_exit, NULL, 1000);
@@ -81,6 +82,7 @@
mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF);
break;
case MOD_UNLOAD:
+ linux_dev_shm_destroy();
linux_osd_jail_deregister();
SET_FOREACH(ldhp, linux_device_handler_set)
linux_device_unregister_handler(*ldhp);
Index: head/sys/i386/linux/linux_sysvec.c
===================================================================
--- head/sys/i386/linux/linux_sysvec.c
+++ head/sys/i386/linux/linux_sysvec.c
@@ -1006,6 +1006,7 @@
linux_get_machine(&linux_kplatform);
linux_szplatform = roundup(strlen(linux_kplatform) + 1,
sizeof(char *));
+ linux_dev_shm_create();
linux_osd_jail_register();
stclohz = (stathz ? stathz : hz);
if (bootverbose)
@@ -1031,6 +1032,7 @@
EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag);
EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag);
+ linux_dev_shm_destroy();
linux_osd_jail_deregister();
if (bootverbose)
printf("Linux ELF exec handler removed\n");

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 12, 9:44 PM (13 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29596982
Default Alt Text
D20333.id.diff (2 KB)

Event Timeline