diff -urNp 2.5.29/arch/i386/kernel/entry.S aio-api-1/arch/i386/kernel/entry.S --- 2.5.29/arch/i386/kernel/entry.S Sat Jul 27 06:07:21 2002 +++ aio-api-1/arch/i386/kernel/entry.S Tue Jul 30 05:23:46 2002 @@ -753,6 +753,12 @@ ENTRY(sys_call_table) .long sys_sched_setaffinity .long sys_sched_getaffinity .long sys_set_thread_area + .long sys_io_setup + .long sys_io_destroy /* 245 */ + .long sys_io_submit + .long sys_io_cancel + .long sys_io_wait + .long sys_io_getevents .rept NR_syscalls-(.-sys_call_table)/4 .long sys_ni_syscall diff -urNp 2.5.29/fs/Makefile aio-api-1/fs/Makefile --- 2.5.29/fs/Makefile Wed Jul 17 02:13:47 2002 +++ aio-api-1/fs/Makefile Tue Jul 30 05:25:03 2002 @@ -15,7 +15,7 @@ obj-y := open.o read_write.o devices.o f namei.o fcntl.o ioctl.o readdir.o select.o fifo.o locks.o \ dcache.o inode.o attr.o bad_inode.o file.o iobuf.o dnotify.o \ filesystems.o namespace.o seq_file.o xattr.o libfs.o \ - fs-writeback.o mpage.o direct-io.o + fs-writeback.o mpage.o direct-io.o aio.o ifneq ($(CONFIG_NFSD),n) ifneq ($(CONFIG_NFSD),) diff -urNp 2.5.29/fs/aio.c aio-api-1/fs/aio.c --- 2.5.29/fs/aio.c Thu Jan 1 01:00:00 1970 +++ aio-api-1/fs/aio.c Tue Jul 30 05:33:20 2002 @@ -0,0 +1,38 @@ +#include +#include +#include +#include + +asmlinkage long sys_io_setup(unsigned nr_reqs, aio_context_t *ctxp) +{ + return -ENOSYS; +} + +asmlinkage long sys_io_destroy(aio_context_t ctx) +{ + return -ENOSYS; +} + +asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp) +{ + return -ENOSYS; +} + +asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb) +{ + return -ENOSYS; +} + +asmlinkage long sys_io_wait(aio_context_t ctx_id, struct iocb *iocb, + const struct timespec *timeout) +{ + return -ENOSYS; +} + +asmlinkage long sys_io_getevents(aio_context_t ctx_id, + long nr, + struct io_event *events, + const struct timespec *timeout) +{ + return -ENOSYS; +} diff -urNp 2.5.29/include/asm-i386/unistd.h aio-api-1/include/asm-i386/unistd.h --- 2.5.29/include/asm-i386/unistd.h Sun Apr 14 22:09:06 2002 +++ aio-api-1/include/asm-i386/unistd.h Tue Jul 30 05:22:38 2002 @@ -247,6 +247,13 @@ #define __NR_futex 240 #define __NR_sched_setaffinity 241 #define __NR_sched_getaffinity 242 +#define __NR_set_thread_area 243 +#define __NR_io_setup 244 +#define __NR_io_destroy 245 +#define __NR_io_submit 246 +#define __NR_io_cancel 247 +#define __NR_io_wait 248 +#define __NR_io_getevents 249 /* user-visible error numbers are in the range -1 - -124: see */ diff -urNp 2.5.29/include/linux/aio.h aio-api-1/include/linux/aio.h --- 2.5.29/include/linux/aio.h Thu Jan 1 01:00:00 1970 +++ aio-api-1/include/linux/aio.h Tue Jul 30 05:32:30 2002 @@ -0,0 +1,6 @@ +#ifndef __LINUX__AIO_H +#define __LINUX__AIO_H + +#include + +#endif /* __LINUX__AIO_H */ diff -urNp 2.5.29/include/linux/aio_abi.h aio-api-1/include/linux/aio_abi.h --- 2.5.29/include/linux/aio_abi.h Thu Jan 1 01:00:00 1970 +++ aio-api-1/include/linux/aio_abi.h Tue Jul 30 05:57:23 2002 @@ -0,0 +1,86 @@ +/* linux/aio_abi.h + * + * Copyright 2000,2001,2002 Red Hat. + * + * Written by Benjamin LaHaise + * + * Permission to use, copy, modify, and distribute this software and its + * documentation is hereby granted, provided that the above copyright + * notice appears in all copies. This software is provided without any + * warranty, express or implied. Red Hat makes no representations about + * the suitability of this software for any purpose. + * + * IN NO EVENT SHALL RED HAT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, + * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF + * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RED HAT HAS BEEN ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * RED HAT DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND + * RED HAT HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, + * ENHANCEMENTS, OR MODIFICATIONS. + */ +#ifndef __LINUX__AIO_ABI_H +#define __LINUX__AIO_ABI_H + +#include + +typedef unsigned long aio_context_t; + +enum { + IOCB_CMD_PREAD = 0, + IOCB_CMD_PWRITE = 1, + IOCB_CMD_FSYNC = 2, + IOCB_CMD_FDSYNC = 3, + IOCB_CMD_PREADX = 4, + IOCB_CMD_POLL = 5, + IOCB_CMD_NOOP = 6, +}; + +/* read() from /dev/aio returns these structures. */ +struct io_event { + __u64 data; /* the data field from the iocb */ + __u64 obj; /* what iocb this event came from */ + __s64 res; /* result code for this event */ + __s64 res2; /* secondary result */ +}; + +#if defined(__LITTLE_ENDIAN) +#define PADDED(x,y) x, y +#elif defined(__BIG_ENDIAN) +#define PADDED(x,y) y, x +#else +#error edit for your odd byteorder. +#endif + +/* + * we always use a 64bit off_t when communicating + * with userland. its up to libraries to do the + * proper padding and aio_error abstraction + */ + +struct iocb { + /* these are internal to the kernel/libc. */ + __u64 aio_data; /* data to be returned in event's data */ + __u32 PADDED(aio_key, aio_reserved1); + /* the kernel sets aio_key to the req # */ + + /* common fields */ + __u16 aio_lio_opcode; /* see IOCB_CMD_ above */ + __s16 aio_reqprio; + __u32 aio_fildes; + + __u64 aio_buf; + __u64 aio_nbytes; + __s64 aio_offset; + + /* extra parameters */ + __u64 aio_reserved2; + __u64 aio_reserved3; +}; /* 64 bytes */ + +#undef IFBIG +#undef IFLITTLE + +#endif /* __LINUX__AIO_ABI_H */