Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Sep 2006 09:56:13 GMT
From:      Alexander Leidinger <netchild@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 105930 for review
Message-ID:  <200609100956.k8A9uD0P094639@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105930

Change 105930 by netchild@netchild_magellan on 2006/09/10 09:55:14

	From the submitter:
	---snip---
	DESIGN NOTES:
	
	1. Linux permits a process to own multiple AIO queues (distinguished by
	   "context"), but FreeBSD creates only one single AIO queue per process.
	   My code maintains a request queue (STAILQ of queue(3)) per "context",
	   and throws all AIO requests of all contexts owned by a process into
	   the single FreeBSD per-process AIO queue.
	
	   When the process calls io_destroy(2), io_getevents(2), io_submit(2) and
	   io_cancel(2), my code can pick out requests owned by the specified context
	   from the single FreeBSD per-process AIO queue according to the per-context
	   request queues maintained by my code.
	
	2. The request queue maintained by my code stores contrast information between
	   Linux IO control blocks (struct linux_iocb) and FreeBSD IO control blocks
	   (struct aiocb). FreeBSD IO control block actually exists in userland memory
	   space, required by FreeBSD native aio_XXXXXX(2).
	
	3. It is quite troubling that the function io_getevents() of libaio-0.3.105
	   needs to use Linux-specific "struct aio_ring", which is a partial mirror
	   of context in user space. I would rather take the address of context in
	   kernel as the context ID, but the io_getevents() of libaio forces me to
	   take the address of the "ring" in user space as the context ID.
	
	   To my surprise, one comment line in the file "io_getevents.c" of
	   libaio-0.3.105 reads:
	
	             Ben will hate me for this
	
	PROBLEMS:
	
	1. Why does uma_zdestroy(9) print message like:
	
	      Freed UMA keg was not empty (100 items).  Lost 2 pages of memory.
	
	   Does it represent any problems?
	
	2. FreeBSD-Linux errno transformation table "bsd_to_linux_errno" in
	   "/sys/i386/linux/linux_sysvec.c" should be updated now.
	   I cannot even find correct Linux's -ECANCELED (-125) in it.
	
	REFERENCE:
	
	1. Linux kernel source code:   http://www.kernel.org/pub/linux/kernel/v2.6/
	   (include/linux/aio_abi.h, fs/aio.c)
	
	2. Linux manual pages:         http://www.kernel.org/pub/linux/docs/manpages/
	   (io_setup(2), io_destroy(2), io_getevents(2), io_submit(2), io_cancel(2))
	
	3. Linux Scalability Effort:   http://lse.sourceforge.net/io/aio.html
	   The design notes:           http://lse.sourceforge.net/io/aionotes.txt
	
	4. The package libaio, both source and binary:
	       http://rpmfind.net/linux/rpm2html/search.php?query=libaio
	   Simple transparent interface to Linux AIO system calls.
	
	5. Libaio-oracle:              http://oss.oracle.com/projects/libaio-oracle/
	   POSIX AIO implementation based on Linux AIO system calls (depending on
	   libaio).
	---snip---
	Submitted by:	Intron <mag@intron.ac>

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#3 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#2 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#2 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#2 edit
.. //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#2 edit
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_aio.c#1 add
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_aio.h#1 add
.. //depot/projects/linuxolator/src/sys/conf/files.amd64#2 edit
.. //depot/projects/linuxolator/src/sys/conf/files.i386#2 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#3 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#2 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#2 edit
.. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#2 edit
.. //depot/projects/linuxolator/src/sys/kern/vfs_aio.c#2 edit
.. //depot/projects/linuxolator/src/sys/modules/aio/Makefile#2 edit
.. //depot/projects/linuxolator/src/sys/modules/linux/Makefile#2 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#3 (text+ko) ====

@@ -840,4 +840,6 @@
 
 #define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
 
+#include <compat/linux/linux_aio.h>
+
 #endif /* !_AMD64_LINUX_LINUX_H_ */

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.22 2006/08/27 08:58:00 netchild Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp 
  */
 
@@ -724,6 +724,30 @@
 	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
 	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
 };
+struct linux_io_setup_args {
+	char nr_reqs_l_[PADL_(l_uint)]; l_uint nr_reqs; char nr_reqs_r_[PADR_(l_uint)];
+	char ctxp_l_[PADL_(linux_aio_context_t *)]; linux_aio_context_t * ctxp; char ctxp_r_[PADR_(linux_aio_context_t *)];
+};
+struct linux_io_destroy_args {
+	char ctx_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx; char ctx_r_[PADR_(linux_aio_context_t)];
+};
+struct linux_io_getevents_args {
+	char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+	char min_nr_l_[PADL_(l_long)]; l_long min_nr; char min_nr_r_[PADR_(l_long)];
+	char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)];
+	char events_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * events; char events_r_[PADR_(struct linux_io_event *)];
+	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
+};
+struct linux_io_submit_args {
+	char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+	char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)];
+	char iocbpp_l_[PADL_(struct linux_iocb **)]; struct linux_iocb ** iocbpp; char iocbpp_r_[PADR_(struct linux_iocb **)];
+};
+struct linux_io_cancel_args {
+	char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+	char iocb_l_[PADL_(struct linux_iocb *)]; struct linux_iocb * iocb; char iocb_r_[PADR_(struct linux_iocb *)];
+	char result_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * result; char result_r_[PADR_(struct linux_io_event *)];
+};
 struct linux_fadvise64_args {
 	register_t dummy;
 };
@@ -1081,6 +1105,11 @@
 int	linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *);
 int	linux_tkill(struct thread *, struct linux_tkill_args *);
 int	linux_sys_futex(struct thread *, struct linux_sys_futex_args *);
+int	linux_io_setup(struct thread *, struct linux_io_setup_args *);
+int	linux_io_destroy(struct thread *, struct linux_io_destroy_args *);
+int	linux_io_getevents(struct thread *, struct linux_io_getevents_args *);
+int	linux_io_submit(struct thread *, struct linux_io_submit_args *);
+int	linux_io_cancel(struct thread *, struct linux_io_cancel_args *);
 int	linux_fadvise64(struct thread *, struct linux_fadvise64_args *);
 int	linux_exit_group(struct thread *, struct linux_exit_group_args *);
 int	linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *);
@@ -1326,6 +1355,11 @@
 #define	LINUX_SYS_AUE_linux_fremovexattr	AUE_NULL
 #define	LINUX_SYS_AUE_linux_tkill	AUE_NULL
 #define	LINUX_SYS_AUE_linux_sys_futex	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_setup	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_destroy	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_getevents	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_submit	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_cancel	AUE_NULL
 #define	LINUX_SYS_AUE_linux_fadvise64	AUE_NULL
 #define	LINUX_SYS_AUE_linux_exit_group	AUE_EXIT
 #define	LINUX_SYS_AUE_linux_lookup_dcookie	AUE_NULL

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.22 2006/08/27 08:58:00 netchild Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp 
  */
 
@@ -221,6 +221,11 @@
 #define	LINUX_SYS_linux_fremovexattr	237
 #define	LINUX_SYS_linux_tkill	238
 #define	LINUX_SYS_linux_sys_futex	240
+#define	LINUX_SYS_linux_io_setup	245
+#define	LINUX_SYS_linux_io_destroy	246
+#define	LINUX_SYS_linux_io_getevents	247
+#define	LINUX_SYS_linux_io_submit	248
+#define	LINUX_SYS_linux_io_cancel	249
 #define	LINUX_SYS_linux_fadvise64	250
 #define	LINUX_SYS_linux_exit_group	252
 #define	LINUX_SYS_linux_lookup_dcookie	253

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.22 2006/08/27 08:58:00 netchild Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp 
  */
 
@@ -265,11 +265,11 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 242 = linux_sched_getaffinity */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 243 = linux_set_thread_area */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 244 = linux_get_thread_area */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 245 = linux_io_setup */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 246 = linux_io_destroy */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 247 = linux_io_getevents */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 248 = linux_io_submit */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 249 = linux_io_cancel */
+	{ AS(linux_io_setup_args), (sy_call_t *)linux_io_setup, AUE_NULL, NULL, 0, 0 },	/* 245 = linux_io_setup */
+	{ AS(linux_io_destroy_args), (sy_call_t *)linux_io_destroy, AUE_NULL, NULL, 0, 0 },	/* 246 = linux_io_destroy */
+	{ AS(linux_io_getevents_args), (sy_call_t *)linux_io_getevents, AUE_NULL, NULL, 0, 0 },	/* 247 = linux_io_getevents */
+	{ AS(linux_io_submit_args), (sy_call_t *)linux_io_submit, AUE_NULL, NULL, 0, 0 },	/* 248 = linux_io_submit */
+	{ AS(linux_io_cancel_args), (sy_call_t *)linux_io_cancel, AUE_NULL, NULL, 0, 0 },	/* 249 = linux_io_cancel */
 	{ 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 },	/* 250 = linux_fadvise64 */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 251 =  */
 	{ AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 },	/* 252 = linux_exit_group */

==== //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#2 (text+ko) ====

@@ -406,11 +406,11 @@
 242	AUE_NULL	UNIMPL	linux_sched_getaffinity
 243	AUE_NULL	UNIMPL	linux_set_thread_area
 244	AUE_NULL	UNIMPL	linux_get_thread_area
-245	AUE_NULL	UNIMPL	linux_io_setup
-246	AUE_NULL	UNIMPL	linux_io_destroy
-247	AUE_NULL	UNIMPL	linux_io_getevents
-248	AUE_NULL	UNIMPL	linux_io_submit
-249	AUE_NULL	UNIMPL	linux_io_cancel
+245	AUE_NULL	STD	{ int linux_io_setup(l_uint nr_reqs, linux_aio_context_t *ctxp); }
+246	AUE_NULL	STD	{ int linux_io_destroy(linux_aio_context_t ctx); }
+247	AUE_NULL	STD	{ int linux_io_getevents(linux_aio_context_t ctx_id, l_long min_nr, l_long nr, struct linux_io_event *events, struct l_timespec *timeout); }
+248	AUE_NULL	STD	{ int linux_io_submit(linux_aio_context_t ctx_id, l_long nr, struct linux_iocb **iocbpp); }
+249	AUE_NULL	STD	{ int linux_io_cancel(linux_aio_context_t ctx_id, struct linux_iocb *iocb, struct linux_io_event *result); }
 250	AUE_NULL	STD	{ int linux_fadvise64(void); }
 251	AUE_NULL	UNIMPL
 252	AUE_EXIT	STD	{ int linux_exit_group(int error_code); }

==== //depot/projects/linuxolator/src/sys/conf/files.amd64#2 (text+ko) ====

@@ -234,6 +234,7 @@
 amd64/linux32/linux32_machdep.c	optional	compat_linux32
 amd64/linux32/linux32_sysent.c	optional	compat_linux32
 amd64/linux32/linux32_sysvec.c	optional	compat_linux32
+compat/linux/linux_aio.c	optional	compat_linux32
 compat/linux/linux_emul.c       optional	compat_linux32
 compat/linux/linux_file.c	optional	compat_linux32
 compat/linux/linux_futex.c	optional	compat_linux32

==== //depot/projects/linuxolator/src/sys/conf/files.i386#2 (text+ko) ====

@@ -85,6 +85,7 @@
 #
 compat/linprocfs/linprocfs.c	optional linprocfs
 compat/linsysfs/linsysfs.c	optional linsysfs
+compat/linux/linux_aio.c	optional compat_linux
 compat/linux/linux_emul.c	optional compat_linux
 compat/linux/linux_file.c	optional compat_linux
 compat/linux/linux_futex.c	optional compat_linux

==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#3 (text+ko) ====

@@ -803,4 +803,6 @@
 
 #define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
 
+#include <compat/linux/linux_aio.h>
+
 #endif /* !_I386_LINUX_LINUX_H_ */

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.81 2006/08/27 08:58:00 netchild Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp 
  */
 
@@ -721,6 +721,30 @@
 struct linux_get_thread_area_args {
 	char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)];
 };
+struct linux_io_setup_args {
+	char nr_reqs_l_[PADL_(l_uint)]; l_uint nr_reqs; char nr_reqs_r_[PADR_(l_uint)];
+	char ctxp_l_[PADL_(linux_aio_context_t *)]; linux_aio_context_t * ctxp; char ctxp_r_[PADR_(linux_aio_context_t *)];
+};
+struct linux_io_destroy_args {
+	char ctx_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx; char ctx_r_[PADR_(linux_aio_context_t)];
+};
+struct linux_io_getevents_args {
+	char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+	char min_nr_l_[PADL_(l_long)]; l_long min_nr; char min_nr_r_[PADR_(l_long)];
+	char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)];
+	char events_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * events; char events_r_[PADR_(struct linux_io_event *)];
+	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
+};
+struct linux_io_submit_args {
+	char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+	char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)];
+	char iocbpp_l_[PADL_(struct linux_iocb **)]; struct linux_iocb ** iocbpp; char iocbpp_r_[PADR_(struct linux_iocb **)];
+};
+struct linux_io_cancel_args {
+	char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)];
+	char iocb_l_[PADL_(struct linux_iocb *)]; struct linux_iocb * iocb; char iocb_r_[PADR_(struct linux_iocb *)];
+	char result_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * result; char result_r_[PADR_(struct linux_io_event *)];
+};
 struct linux_fadvise64_args {
 	register_t dummy;
 };
@@ -1098,6 +1122,11 @@
 int	linux_sys_futex(struct thread *, struct linux_sys_futex_args *);
 int	linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *);
 int	linux_get_thread_area(struct thread *, struct linux_get_thread_area_args *);
+int	linux_io_setup(struct thread *, struct linux_io_setup_args *);
+int	linux_io_destroy(struct thread *, struct linux_io_destroy_args *);
+int	linux_io_getevents(struct thread *, struct linux_io_getevents_args *);
+int	linux_io_submit(struct thread *, struct linux_io_submit_args *);
+int	linux_io_cancel(struct thread *, struct linux_io_cancel_args *);
 int	linux_fadvise64(struct thread *, struct linux_fadvise64_args *);
 int	linux_exit_group(struct thread *, struct linux_exit_group_args *);
 int	linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *);
@@ -1344,6 +1373,11 @@
 #define	LINUX_SYS_AUE_linux_sys_futex	AUE_NULL
 #define	LINUX_SYS_AUE_linux_set_thread_area	AUE_NULL
 #define	LINUX_SYS_AUE_linux_get_thread_area	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_setup	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_destroy	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_getevents	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_submit	AUE_NULL
+#define	LINUX_SYS_AUE_linux_io_cancel	AUE_NULL
 #define	LINUX_SYS_AUE_linux_fadvise64	AUE_NULL
 #define	LINUX_SYS_AUE_linux_exit_group	AUE_EXIT
 #define	LINUX_SYS_AUE_linux_lookup_dcookie	AUE_NULL

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.75 2006/08/27 08:58:00 netchild Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp 
  */
 
@@ -230,6 +230,11 @@
 #define	LINUX_SYS_linux_sys_futex	240
 #define	LINUX_SYS_linux_set_thread_area	243
 #define	LINUX_SYS_linux_get_thread_area	244
+#define	LINUX_SYS_linux_io_setup	245
+#define	LINUX_SYS_linux_io_destroy	246
+#define	LINUX_SYS_linux_io_getevents	247
+#define	LINUX_SYS_linux_io_submit	248
+#define	LINUX_SYS_linux_io_cancel	249
 #define	LINUX_SYS_linux_fadvise64	250
 #define	LINUX_SYS_linux_exit_group	252
 #define	LINUX_SYS_linux_lookup_dcookie	253

==== //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#2 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.82 2006/08/27 08:58:00 netchild Exp $
+ * $FreeBSD$
  * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp 
  */
 
@@ -264,11 +264,11 @@
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 242 = linux_sched_getaffinity */
 	{ AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 },	/* 243 = linux_set_thread_area */
 	{ AS(linux_get_thread_area_args), (sy_call_t *)linux_get_thread_area, AUE_NULL, NULL, 0, 0 },	/* 244 = linux_get_thread_area */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 245 = linux_io_setup */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 246 = linux_io_destroy */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 247 = linux_io_getevents */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 248 = linux_io_submit */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 249 = linux_io_cancel */
+	{ AS(linux_io_setup_args), (sy_call_t *)linux_io_setup, AUE_NULL, NULL, 0, 0 },	/* 245 = linux_io_setup */
+	{ AS(linux_io_destroy_args), (sy_call_t *)linux_io_destroy, AUE_NULL, NULL, 0, 0 },	/* 246 = linux_io_destroy */
+	{ AS(linux_io_getevents_args), (sy_call_t *)linux_io_getevents, AUE_NULL, NULL, 0, 0 },	/* 247 = linux_io_getevents */
+	{ AS(linux_io_submit_args), (sy_call_t *)linux_io_submit, AUE_NULL, NULL, 0, 0 },	/* 248 = linux_io_submit */
+	{ AS(linux_io_cancel_args), (sy_call_t *)linux_io_cancel, AUE_NULL, NULL, 0, 0 },	/* 249 = linux_io_cancel */
 	{ 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 },	/* 250 = linux_fadvise64 */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 251 =  */
 	{ AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 },	/* 252 = linux_exit_group */

==== //depot/projects/linuxolator/src/sys/kern/vfs_aio.c#2 (text+ko) ====

@@ -139,7 +139,7 @@
 SYSCTL_INT(_vfs_aio, OID_AUTO, target_aio_procs, CTLFLAG_RW, &target_aio_procs,
 	0, "Preferred number of ready kernel threads for async IO");
 
-static int max_queue_count = MAX_AIO_QUEUE;
+int max_queue_count = MAX_AIO_QUEUE;
 SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue, CTLFLAG_RW, &max_queue_count, 0,
     "Maximum number of aio requests to queue, globally");
 
@@ -172,7 +172,7 @@
 SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_per_proc, CTLFLAG_RW, &max_aio_per_proc,
     0, "Maximum active aio requests per process (stored in the process)");
 
-static int max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC;
+int max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC;
 SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue_per_proc, CTLFLAG_RW,
     &max_aio_queue_per_proc, 0,
     "Maximum queued aio requests per process (stored in the process)");
@@ -313,12 +313,12 @@
 static TAILQ_HEAD(,aiocblist) aio_jobs;			/* (c) Async job list */
 static struct unrhdr *aiod_unr;
 
-static void	aio_init_aioinfo(struct proc *p);
+void	aio_init_aioinfo(struct proc *p);
 static void	aio_onceonly(void);
 static int	aio_free_entry(struct aiocblist *aiocbe);
 static void	aio_process(struct aiocblist *aiocbe);
 static int	aio_newproc(int *);
-static int	aio_aqueue(struct thread *td, struct aiocb *job,
+int	aio_aqueue(struct thread *td, struct aiocb *job,
 			struct aioliojob *lio, int type, int osigev);
 static void	aio_physwakeup(struct buf *bp);
 static void	aio_proc_rundown(void *arg, struct proc *p);
@@ -498,7 +498,7 @@
  * Init the per-process aioinfo structure.  The aioinfo limits are set
  * per-process for user limit (resource) management.
  */
-static void
+void
 aio_init_aioinfo(struct proc *p)
 {
 	struct kaioinfo *ki;
@@ -1322,7 +1322,7 @@
  * Queue a new AIO request.  Choosing either the threaded or direct physio VCHR
  * technique is done in this code.
  */
-static int
+int
 aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj,
 	int type, int oldsigev)
 {

==== //depot/projects/linuxolator/src/sys/modules/aio/Makefile#2 (text+ko) ====

@@ -5,4 +5,8 @@
 KMOD=	aio
 SRCS=	vfs_aio.c opt_vfs_aio.h vnode_if.h
 
+EXPORT_SYMS= max_aio_queue_per_proc max_queue_count \
+	aio_init_aioinfo aio_aqueue aio_suspend \
+	aio_cancel aio_return aio_error
+
 .include <bsd.kmod.mk>

==== //depot/projects/linuxolator/src/sys/modules/linux/Makefile#2 (text+ko) ====

@@ -8,11 +8,13 @@
 .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
 
 KMOD=	linux
-SRCS=	linux${SFX}_dummy.c linux_emul.c linux_file.c linux_futex.c linux_getcwd.c linux_ioctl.c \
-	linux_ipc.c linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
-	linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c linux${SFX}_sysvec.c \
-	linux_uid16.c linux_util.c linux_time.c opt_inet6.h opt_mac.h opt_compat.h opt_posix.h \
-	vnode_if.h device_if.h bus_if.h
+SRCS=	linux_aio.c linux${SFX}_dummy.c linux_emul.c linux_file.c \
+	linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
+	linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
+	linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
+	linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
+	opt_inet6.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \
+	device_if.h bus_if.h
 OBJS=	linux${SFX}_locore.o
 
 .if ${MACHINE_ARCH} == "i386"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609100956.k8A9uD0P094639>