diff -ruN linux-2.2.16-stefan-buffercachefix-fijiji2-orig/fs/buffer.c linux-2.2.16-stefan-buffercachefix-fijiji2/fs/buffer.c
--- linux-2.2.16-stefan-buffercachefix-fijiji2-orig/fs/buffer.c	Sat Aug  5 18:29:13 2000
+++ linux-2.2.16-stefan-buffercachefix-fijiji2/fs/buffer.c	Sat Aug  5 18:50:47 2000
@@ -122,6 +122,12 @@
 
 void wakeup_bdflush(int);
 
+/* sync, fsync, fdatasync, open(, O_SYNC), msync */
+int nosync_prm[5] = { 0, 0, 0, 0, 0 };
+int nosync_min[5] = { 0, 0, 0, 0, 0 };
+int nosync_max[5] = { 1, 1, 1, 1, 1 };
+
+
 /*
  * Rewrote the wait-routines to use the "new" wait-queue functionality,
  * and getting rid of the cli-sti pairs. The wait-queue routines still
@@ -299,6 +305,8 @@
 
 asmlinkage int sys_sync(void)
 {
+	if(nosync_prm[0])
+		return 0;
 	lock_kernel();
 	fsync_dev(0);
 	unlock_kernel();
@@ -336,6 +344,10 @@
 	struct inode * inode;
 	int err;
 
+	/* this allows fsync on random fd... */
+	if(nosync_prm[1]) 
+		return 0;
+
 	lock_kernel();
 	err = -EBADF;
 	file = fget(fd);
@@ -372,6 +384,10 @@
 	struct dentry * dentry;
 	struct inode * inode;
 	int err;
+
+	/* this allows fdatasync on random fd... */
+	if(nosync_prm[2]) 
+		return 0;
 
 	lock_kernel();
 	err = -EBADF;
diff -ruN linux-2.2.16-stefan-buffercachefix-fijiji2-orig/fs/open.c linux-2.2.16-stefan-buffercachefix-fijiji2/fs/open.c
--- linux-2.2.16-stefan-buffercachefix-fijiji2-orig/fs/open.c	Mon Jan 10 18:08:06 2000
+++ linux-2.2.16-stefan-buffercachefix-fijiji2/fs/open.c	Sat Aug  5 18:53:08 2000
@@ -634,6 +634,7 @@
  * for the internal routines (ie open_namei()/follow_link() etc). 00 is
  * used by symlinks.
  */
+
 struct file *filp_open(const char * filename, int flags, int mode)
 {
 	struct inode * inode;
@@ -755,10 +756,15 @@
 		current->files->next_fd = fd;
 }
 
+extern int nosync_prm[];
+
 asmlinkage int sys_open(const char * filename, int flags, int mode)
 {
 	char * tmp;
 	int fd, error;
+
+	if(nosync_prm[3])
+		flags &= ~O_SYNC;
 
 	tmp = getname(filename);
 	fd = PTR_ERR(tmp);
diff -ruN linux-2.2.16-stefan-buffercachefix-fijiji2-orig/include/linux/sysctl.h linux-2.2.16-stefan-buffercachefix-fijiji2/include/linux/sysctl.h
--- linux-2.2.16-stefan-buffercachefix-fijiji2-orig/include/linux/sysctl.h	Sat Aug  5 18:29:12 2000
+++ linux-2.2.16-stefan-buffercachefix-fijiji2/include/linux/sysctl.h	Sat Aug  5 18:37:25 2000
@@ -121,7 +121,8 @@
 	VM_PAGECACHE=7,		/* struct: Set cache memory thresholds */
 	VM_PAGERDAEMON=8,	/* struct: Control kswapd behaviour */
 	VM_PGT_CACHE=9,		/* struct: Set page table cache parameters */
-	VM_PAGE_CLUSTER=10	/* int: set number of pages to swap together */
+	VM_PAGE_CLUSTER=10,	/* int: set number of pages to swap together */
+	VM_NOSYNC=11            /* int: disable sync,fsync,fdatasync,open(,OSYNC),msync */
 };
 
 
diff -ruN linux-2.2.16-stefan-buffercachefix-fijiji2-orig/kernel/sysctl.c linux-2.2.16-stefan-buffercachefix-fijiji2/kernel/sysctl.c
--- linux-2.2.16-stefan-buffercachefix-fijiji2-orig/kernel/sysctl.c	Sat Aug  5 18:29:12 2000
+++ linux-2.2.16-stefan-buffercachefix-fijiji2/kernel/sysctl.c	Sat Aug  5 18:40:31 2000
@@ -35,6 +35,7 @@
 extern int panic_timeout;
 extern int console_loglevel, C_A_D;
 extern int bdf_prm[], bdflush_min[], bdflush_max[];
+extern int nosync_prm[], nosync_min[], nosync_max[];
 extern char binfmt_java_interpreter[], binfmt_java_appletviewer[];
 extern int sysctl_overcommit_memory;
 extern int nr_queued_signals, max_queued_signals;
@@ -252,6 +253,9 @@
 	 &pgt_cache_water, 2*sizeof(int), 0600, NULL, &proc_dointvec},
 	{VM_PAGE_CLUSTER, "page-cluster", 
 	 &page_cluster, sizeof(int), 0600, NULL, &proc_dointvec},
+	{VM_NOSYNC, "nosync", &nosync_prm, 5*sizeof(int), 0600, NULL,
+	 &proc_dointvec_minmax, &sysctl_intvec, NULL,
+	 &nosync_min, &nosync_max},
 	{0}
 };
 
diff -ruN linux-2.2.16-stefan-buffercachefix-fijiji2-orig/mm/filemap.c linux-2.2.16-stefan-buffercachefix-fijiji2/mm/filemap.c
--- linux-2.2.16-stefan-buffercachefix-fijiji2-orig/mm/filemap.c	Sat Aug  5 18:29:12 2000
+++ linux-2.2.16-stefan-buffercachefix-fijiji2/mm/filemap.c	Sat Aug  5 18:57:01 2000
@@ -1395,11 +1395,16 @@
 	return 0;
 }
 
+extern int nosync_prm[];
+
 asmlinkage int sys_msync(unsigned long start, size_t len, int flags)
 {
 	unsigned long end;
 	struct vm_area_struct * vma;
 	int unmapped_error, error = -EINVAL;
+
+	if(nosync_prm[4])
+		return 0;
 
 	down(&current->mm->mmap_sem);
 	lock_kernel();
