summaryrefslogtreecommitdiffstats
path: root/fs/ufs/dir.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov2006-06-25 14:47:25 +0200
committerLinus Torvalds2006-06-25 19:01:03 +0200
commitdd187a2603d9904ddc410441348f0cfc558a5233 (patch)
treea3859f88d1f458a18d31a231f03c955393282255 /fs/ufs/dir.c
parent[PATCH] ufs: easy debug (diff)
downloadkernel-qcow2-linux-dd187a2603d9904ddc410441348f0cfc558a5233.tar.gz
kernel-qcow2-linux-dd187a2603d9904ddc410441348f0cfc558a5233.tar.xz
kernel-qcow2-linux-dd187a2603d9904ddc410441348f0cfc558a5233.zip
[PATCH] ufs: little directory lookup optimization
This patch make little optimization of ufs_find_entry like "ext2" does. Save number of page and reuse it again in the next call. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/dir.c')
-rw-r--r--fs/ufs/dir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 732c3fd2b6f2..7f0a0aa63584 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -252,6 +252,7 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, struct dentry *dentry,
unsigned long start, n;
unsigned long npages = ufs_dir_pages(dir);
struct page *page = NULL;
+ struct ufs_inode_info *ui = UFS_I(dir);
struct ufs_dir_entry *de;
UFSD("ENTER, dir_ino %lu, name %s, namlen %u\n", dir->i_ino, name, namelen);
@@ -262,8 +263,8 @@ struct ufs_dir_entry *ufs_find_entry(struct inode *dir, struct dentry *dentry,
/* OFFSET_CACHE */
*res_page = NULL;
- /* start = ei->i_dir_start_lookup; */
- start = 0;
+ start = ui->i_dir_start_lookup;
+
if (start >= npages)
start = 0;
n = start;
@@ -295,7 +296,7 @@ out:
found:
*res_page = page;
- /* ei->i_dir_start_lookup = n; */
+ ui->i_dir_start_lookup = n;
return de;
}