diff options
author | Andrew Morton <akpm@osdl.org> | 2006-03-23 06:00:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:09 -0500 |
commit | d8733c2956968a01394a4d2a9e97a8b431a78776 (patch) | |
tree | 9743c9020eb5193efa4a0f102b3a7eb1d999c4fd /include | |
parent | b8e31edc10d160a8bf2159541d9d12f2079a0887 (diff) |
[PATCH] ext3_readdir: use generic readahead
Linus points out that ext3_readdir's readahead only cuts in when
ext3_readdir() is operating at the very start of the directory. So for large
directories we end up performing no readahead at all and we suck.
So take it all out and use the core VM's page_cache_readahead(). This means
that ext3 directory reads will use all of readahead's dynamic sizing goop.
Note that we're using the directory's filp->f_ra to hold the readahead state,
but readahead is actually being performed against the underlying blockdev's
address_space. Fortunately the readahead code is all set up to handle this.
Tested with printk. It works. I was struggling to find a real workload which
actually cared.
(The patch also exports page_cache_readahead() to GPL modules)
Cc: "Stephen C. Tweedie" <sct@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ext3_fs.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c0272d73ab20..e7239f2f97a1 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -772,9 +772,12 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned); | |||
772 | 772 | ||
773 | 773 | ||
774 | /* inode.c */ | 774 | /* inode.c */ |
775 | extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); | 775 | int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); |
776 | extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | 776 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); |
777 | extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 777 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
778 | int ext3_get_block_handle(handle_t *handle, struct inode *inode, | ||
779 | sector_t iblock, struct buffer_head *bh_result, int create, | ||
780 | int extend_disksize); | ||
778 | 781 | ||
779 | extern void ext3_read_inode (struct inode *); | 782 | extern void ext3_read_inode (struct inode *); |
780 | extern int ext3_write_inode (struct inode *, int); | 783 | extern int ext3_write_inode (struct inode *, int); |