Re: Making diff(1) of linux kernels faster

From: Benjamin LaHaise (bcrl@redhat.com)
Date: Wed Oct 17 2001 - 14:19:00 EST


On Wed, Oct 17, 2001 at 09:59:35AM -0700, Linus Torvalds wrote:
> And I've for a long time thought about adding a "readahead()" system call.
> There are just too many uses for it, it has come up in many different
> areas..

Well, here's a sendpage for /dev/null which is useful for prefetching. Now
we just need a background open().

                -ben

...~/patches/v2.4.13-pre3-null_sendpage.diff
diff -urN v2.4.13-pre3/drivers/char/mem.c foo-v2.4.13-pre3/drivers/char/mem.c
--- v2.4.13-pre3/drivers/char/mem.c Mon Sep 24 02:16:03 2001
+++ foo-v2.4.13-pre3/drivers/char/mem.c Wed Oct 17 15:12:59 2001
@@ -339,6 +339,12 @@
         return count;
 }
 
+static ssize_t sendpage_null(struct file *file, struct page *page, int offset,
+ size_t size, loff_t *pos, int more)
+{
+ return size;
+}
+
 /*
  * For fun, we are using the MMU for this.
  */
@@ -512,6 +518,7 @@
         llseek: null_lseek,
         read: read_null,
         write: write_null,
+ sendpage: sendpage_null,
 };
 
 #if !defined(__mc68000__)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 23 2001 - 21:00:18 EST