diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2006-04-21 16:49:02 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-09-20 18:53:40 -0400 |
commit | aa9588741db907785e4d92c8b768dd6c9077e6f0 (patch) | |
tree | d34da288a9d296a8a2ba19dfa0f1df8429bd3e33 /fs/ocfs2/namei.c | |
parent | e0b4096d34fbd6b30838c417100c9d0ef73c71f2 (diff) |
ocfs2: implement directory read-ahead
Uptodate.c now knows about read-ahead buffers. Use some more aggressive
logic in ocfs2_readdir().
The two functions which currently use directory read-ahead are
ocfs2_find_entry() and ocfs2_readdir().
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 24126476a8cc..0d3e939b1f56 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include "journal.h" | 56 | #include "journal.h" |
57 | #include "namei.h" | 57 | #include "namei.h" |
58 | #include "suballoc.h" | 58 | #include "suballoc.h" |
59 | #include "super.h" | ||
59 | #include "symlink.h" | 60 | #include "symlink.h" |
60 | #include "sysfile.h" | 61 | #include "sysfile.h" |
61 | #include "uptodate.h" | 62 | #include "uptodate.h" |
@@ -1962,13 +1963,8 @@ restart: | |||
1962 | } | 1963 | } |
1963 | num++; | 1964 | num++; |
1964 | 1965 | ||
1965 | /* XXX: questionable readahead stuff here */ | ||
1966 | bh = ocfs2_bread(dir, b++, &err, 1); | 1966 | bh = ocfs2_bread(dir, b++, &err, 1); |
1967 | bh_use[ra_max] = bh; | 1967 | bh_use[ra_max] = bh; |
1968 | #if 0 // ??? | ||
1969 | if (bh) | ||
1970 | ll_rw_block(READ, 1, &bh); | ||
1971 | #endif | ||
1972 | } | 1968 | } |
1973 | } | 1969 | } |
1974 | if ((bh = bh_use[ra_ptr++]) == NULL) | 1970 | if ((bh = bh_use[ra_ptr++]) == NULL) |
@@ -1976,6 +1972,10 @@ restart: | |||
1976 | wait_on_buffer(bh); | 1972 | wait_on_buffer(bh); |
1977 | if (!buffer_uptodate(bh)) { | 1973 | if (!buffer_uptodate(bh)) { |
1978 | /* read error, skip block & hope for the best */ | 1974 | /* read error, skip block & hope for the best */ |
1975 | ocfs2_error(dir->i_sb, "reading directory %llu, " | ||
1976 | "offset %lu\n", | ||
1977 | (unsigned long long)OCFS2_I(dir)->ip_blkno, | ||
1978 | block); | ||
1979 | brelse(bh); | 1979 | brelse(bh); |
1980 | goto next; | 1980 | goto next; |
1981 | } | 1981 | } |