]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/dir.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
[linux-2.6-omap-h63xx.git] / fs / ext4 / dir.c
index e8ad06e283187fc0ca11985994205024d77a25d9..0fb1e62b20d09e25d89c9cfbf00495212f051afe 100644 (file)
@@ -135,12 +135,14 @@ static int ext4_readdir(struct file * filp,
                map_bh.b_state = 0;
                err = ext4_get_blocks_wrap(NULL, inode, blk, 1, &map_bh, 0, 0);
                if (err > 0) {
-                       page_cache_readahead(sb->s_bdev->bd_inode->i_mapping,
-                               &filp->f_ra,
-                               filp,
-                               map_bh.b_blocknr >>
-                                       (PAGE_CACHE_SHIFT - inode->i_blkbits),
-                               1);
+                       pgoff_t index = map_bh.b_blocknr >>
+                                       (PAGE_CACHE_SHIFT - inode->i_blkbits);
+                       if (!ra_has_index(&filp->f_ra, index))
+                               page_cache_sync_readahead(
+                                       sb->s_bdev->bd_inode->i_mapping,
+                                       &filp->f_ra, filp,
+                                       index, 1);
+                       filp->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT;
                        bh = ext4_bread(NULL, inode, blk, 0, &err);
                }
 
@@ -208,7 +210,7 @@ revalidate:
                                 * not the directory has been modified
                                 * during the copy operation.
                                 */
-                               unsigned long version = filp->f_version;
+                               u64 version = filp->f_version;
 
                                error = filldir(dirent, de->name,
                                                de->name_len,