[PATCH 22/22] Readahead
Jörn Engel
joern at wohnheim.fh-wedel.de
Tue Dec 21 09:13:12 EST 2004
Small changes to readahead functions. I guess they can use some more,
but it was getting late and things looked too complicated.
Signed-off-by: Jörn Engel <joern at wohnheim.fh-wedel.de>
---
blockmtd.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
--- linux-2.6.9cow/drivers/mtd/devices/blockmtd.c~blockmtd_readahead 2004-12-21 02:24:35.000000000 +0100
+++ linux-2.6.9cow/drivers/mtd/devices/blockmtd.c 2004-12-21 02:30:03.000000000 +0100
@@ -54,10 +54,9 @@
#define PAGE_READAHEAD 64
-
void cache_readahead(struct address_space *mapping, int index)
{
- filler_t *filler = (void*)mapping->a_ops->readpage;
+ filler_t *filler = (filler_t*)mapping->a_ops->readpage;
int i, pagei;
unsigned ret = 0;
unsigned long end_index;
@@ -95,17 +94,15 @@
ret++;
}
spin_unlock_irq(&mapping->tree_lock);
- if (ret) {
+ if (ret)
read_cache_pages(mapping, &page_pool, filler, NULL);
- //printk(KERN_INFO "Readahead [%d/%d] pages from [%d]\n",ret,PAGE_READAHEAD,index);
- }
}
static struct page* page_readahead(struct address_space *mapping, int index)
{
- filler_t *filler = (filler_t*)(mapping->a_ops->readpage);
- cache_readahead(mapping,index);
+ filler_t *filler = (filler_t*)mapping->a_ops->readpage;
+ cache_readahead(mapping, index);
return read_cache_page(mapping, index, filler, NULL);
}
More information about the linux-mtd
mailing list