Re: Making diff(1) of linux kernels faster

Benjamin LaHaise
2001-10-17T19:18:56Z

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__)