Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280332
b: refs/heads/master
c: 79c4c37
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Nov 9, 2011
1 parent 32ddcbb commit 967ce8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 114b80ce2c05f91f10fffbf303080357d73c0675
refs/heads/master: 79c4c379c8f16a12c28ea2084db5138e33d17ebd
10 changes: 6 additions & 4 deletions trunk/fs/gfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,12 +1378,14 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
return error;
}

/* gfs2_dir_readahead - Issue read-ahead requests for leaf blocks.
/**
* gfs2_dir_readahead - Issue read-ahead requests for leaf blocks.
*
* Note: we can't calculate each index like dir_e_read can because we don't
* have the leaf, and therefore we don't have the depth, and therefore we
* don't have the length. So we have to just read enough ahead to make up
* for the loss of information. */
* for the loss of information.
*/
static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
struct file_ra_state *f_ra)
{
Expand All @@ -1394,7 +1396,7 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
unsigned count;

/* First check if we've already read-ahead for the whole range. */
if (!f_ra || index + MAX_RA_BLOCKS < f_ra->start)
if (index + MAX_RA_BLOCKS < f_ra->start)
return;

f_ra->start = max((pgoff_t)index, f_ra->start);
Expand Down Expand Up @@ -1448,7 +1450,7 @@ static int dir_e_read(struct inode *inode, u64 *offset, void *opaque,
hash = gfs2_dir_offset2hash(*offset);
index = hash >> (32 - dip->i_depth);

if (f_ra && dip->i_hash_cache == NULL)
if (dip->i_hash_cache == NULL)
f_ra->start = 0;
lp = gfs2_dir_get_hash_table(dip);
if (IS_ERR(lp))
Expand Down

0 comments on commit 967ce8e

Please sign in to comment.