diff -rNc linux-2.6.6/fs/aio.c linux-2.6.6-paio/fs/aio.c
*** linux-2.6.6/fs/aio.c	2004-06-28 14:56:45.576319568 +0200
--- linux-2.6.6-paio/fs/aio.c	2004-07-08 15:45:43.421734288 +0200
***************
*** 41,46 ****
--- 45,53 ----
  /*------ sysctl variables----*/
  atomic_t aio_nr = ATOMIC_INIT(0);	/* current system wide number of aio requests */
  unsigned aio_max_nr = 0x10000;	/* system wide maximum number of aio requests */
+ #if defined(CONFIG_POSIX_AIO)
+ unsigned posix_aio_default_maxevents = 256; /* FIXME: default value for POSIX AIO */
+ #endif /* CONFIG_POSIX_AIO */
  /*----end sysctl variables---*/
  
  static kmem_cache_t	*kiocb_cachep;
***************
*** 945,950 ****
--- 1090,1100 ----
  	unsigned long ctx;
  	long ret;
  
+ #if defined(CONFIG_POSIX_AIO)
+ 	if (nr_events == 0)
+ 		nr_events = posix_aio_default_maxevents;
+ #endif
+ 
  	ret = get_user(ctx, ctxp);
  	if (unlikely(ret))
  		goto out;
diff -rNc linux-2.6.6/include/linux/aio.h linux-2.6.6-paio/include/linux/aio.h
*** linux-2.6.6/include/linux/aio.h	2004-05-10 04:31:59.000000000 +0200
--- linux-2.6.6-paio/include/linux/aio.h	2004-07-08 16:31:48.546371448 +0200
***************
*** 139,144 ****
--- 158,166 ----
  
  /* prototypes */
  extern unsigned aio_max_size;
+ #if defined(CONFIG_POSIX_AIO)
+ extern unsigned posix_aio_default_maxevents;
+ #endif /* CONFIG_POSIX_AIO */
  
  extern ssize_t FASTCALL(wait_on_sync_kiocb(struct kiocb *iocb));
  extern int FASTCALL(aio_put_req(struct kiocb *iocb));
diff -rNc linux-2.6.6/include/linux/sysctl.h linux-2.6.6-paio/include/linux/sysctl.h
*** linux-2.6.6/include/linux/sysctl.h	2004-05-10 04:32:38.000000000 +0200
--- linux-2.6.6-paio/include/linux/sysctl.h	2004-07-08 16:15:59.995573088 +0200
***************
*** 646,651 ****
--- 646,654 ----
  	FS_XFS=17,	/* struct: control xfs parameters */
  	FS_AIO_NR=18,	/* current system-wide number of aio requests */
  	FS_AIO_MAX_NR=19,	/* system-wide maximum number of aio requests */
+ #if defined(CONFIG_POSIX_AIO)
+ 	FS_POSIX_AIO_MAX_NR=20,	/* default value for POSIX AIO max request */
+ #endif /* CONFIG_POSIX_AIO */
  };
  
  /* /proc/sys/fs/quota/ */
diff -rNc linux-2.6.6/kernel/sysctl.c linux-2.6.6-paio/kernel/sysctl.c
*** linux-2.6.6/kernel/sysctl.c	2004-05-10 04:32:00.000000000 +0200
--- linux-2.6.6-paio/kernel/sysctl.c	2004-07-08 16:15:25.983743672 +0200
***************
*** 897,902 ****
--- 897,912 ----
  		.mode		= 0644,
  		.proc_handler	= &proc_dointvec,
  	},
+ #if defined(CONFIG_POSIX_AIO)
+ 	{
+ 		.ctl_name	= FS_POSIX_AIO_MAX_NR,
+ 		.procname	= "posix-aio-default-max-nr",
+ 		.data		= &posix_aio_default_maxevents,
+ 		.maxlen		= sizeof(posix_aio_default_maxevents),
+ 		.mode		= 0644,
+ 		.proc_handler	= &proc_dointvec,
+ 	},
+ #endif /* CONFIG_POSIX_AIO */
  	{ .ctl_name = 0 }
  };
  

