aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2011-11-09 08:46:06 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2011-11-09 08:46:06 -0500
commit79c4c379c8f16a12c28ea2084db5138e33d17ebd (patch)
treef0d9648c0e4d1a087401c2e2cb7a4e5e9c80a99b /fs/gfs2/dir.c
parent114b80ce2c05f91f10fffbf303080357d73c0675 (diff)
GFS2: f_ra is always valid in dir readahead function
As a result, we don't need to test it each time. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r--fs/gfs2/dir.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 91441171bf25..946b6f88939e 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -1378,12 +1378,14 @@ out:
1378 return error; 1378 return error;
1379} 1379}
1380 1380
1381/* gfs2_dir_readahead - Issue read-ahead requests for leaf blocks. 1381/**
1382 * gfs2_dir_readahead - Issue read-ahead requests for leaf blocks.
1382 * 1383 *
1383 * Note: we can't calculate each index like dir_e_read can because we don't 1384 * Note: we can't calculate each index like dir_e_read can because we don't
1384 * have the leaf, and therefore we don't have the depth, and therefore we 1385 * have the leaf, and therefore we don't have the depth, and therefore we
1385 * don't have the length. So we have to just read enough ahead to make up 1386 * don't have the length. So we have to just read enough ahead to make up
1386 * for the loss of information. */ 1387 * for the loss of information.
1388 */
1387static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index, 1389static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
1388 struct file_ra_state *f_ra) 1390 struct file_ra_state *f_ra)
1389{ 1391{
@@ -1394,7 +1396,7 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
1394 unsigned count; 1396 unsigned count;
1395 1397
1396 /* First check if we've already read-ahead for the whole range. */ 1398 /* First check if we've already read-ahead for the whole range. */
1397 if (!f_ra || index + MAX_RA_BLOCKS < f_ra->start) 1399 if (index + MAX_RA_BLOCKS < f_ra->start)
1398 return; 1400 return;
1399 1401
1400 f_ra->start = max((pgoff_t)index, f_ra->start); 1402 f_ra->start = max((pgoff_t)index, f_ra->start);
@@ -1448,7 +1450,7 @@ static int dir_e_read(struct inode *inode, u64 *offset, void *opaque,
1448 hash = gfs2_dir_offset2hash(*offset); 1450 hash = gfs2_dir_offset2hash(*offset);
1449 index = hash >> (32 - dip->i_depth); 1451 index = hash >> (32 - dip->i_depth);
1450 1452
1451 if (f_ra && dip->i_hash_cache == NULL) 1453 if (dip->i_hash_cache == NULL)
1452 f_ra->start = 0; 1454 f_ra->start = 0;
1453 lp = gfs2_dir_get_hash_table(dip); 1455 lp = gfs2_dir_get_hash_table(dip);
1454 if (IS_ERR(lp)) 1456 if (IS_ERR(lp))