diff options
author | Bob Peterson <rpeterso@redhat.com> | 2011-10-27 12:16:06 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-11-08 04:52:12 -0500 |
commit | dfe4d34b39b80faff52489f950a18523da7581bf (patch) | |
tree | be478e2c4988612eef88a1669f774dd8f9f9b8af /fs/gfs2/export.c | |
parent | 20ed0535d35b74c9e4fa5777766d6e836fe3c90c (diff) |
GFS2: Add readahead to sequential directory traversal
This patch adds read-ahead capability to GFS2's
directory hash table management. It greatly improves
performance for some directory operations. For example:
In one of my file systems that has 1000 directories, each
of which has 1000 files, time to execute a recursive
ls (time ls -fR /mnt/gfs2 > /dev/null) was reduced
from 2m2.814s on a stock kernel to 0m45.938s.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/export.c')
-rw-r--r-- | fs/gfs2/export.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c index fe9945f2ff72..70ba891654f8 100644 --- a/fs/gfs2/export.c +++ b/fs/gfs2/export.c | |||
@@ -99,6 +99,7 @@ static int gfs2_get_name(struct dentry *parent, char *name, | |||
99 | struct gfs2_holder gh; | 99 | struct gfs2_holder gh; |
100 | u64 offset = 0; | 100 | u64 offset = 0; |
101 | int error; | 101 | int error; |
102 | struct file_ra_state f_ra = { .start = 0 }; | ||
102 | 103 | ||
103 | if (!dir) | 104 | if (!dir) |
104 | return -EINVAL; | 105 | return -EINVAL; |
@@ -118,7 +119,7 @@ static int gfs2_get_name(struct dentry *parent, char *name, | |||
118 | if (error) | 119 | if (error) |
119 | return error; | 120 | return error; |
120 | 121 | ||
121 | error = gfs2_dir_read(dir, &offset, &gnfd, get_name_filldir); | 122 | error = gfs2_dir_read(dir, &offset, &gnfd, get_name_filldir, &f_ra); |
122 | 123 | ||
123 | gfs2_glock_dq_uninit(&gh); | 124 | gfs2_glock_dq_uninit(&gh); |
124 | 125 | ||