aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/dir.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-06-25 08:47:25 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:03 -0400
commitdd187a2603d9904ddc410441348f0cfc558a5233 (patch)
treea3859f88d1f458a18d31a231f03c955393282255 /fs/ufs/dir.c
parentabf5d15fd2e52517dd56a17a846d5a1f900b7db4 (diff)
[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,
252 unsigned long start, n; 252 unsigned long start, n;
253 unsigned long npages = ufs_dir_pages(dir); 253 unsigned long npages = ufs_dir_pages(dir);
254 struct page *page = NULL; 254 struct page *page = NULL;
255 struct ufs_inode_info *ui = UFS_I(dir);
255 struct ufs_dir_entry *de; 256 struct ufs_dir_entry *de;
256 257
257 UFSD("ENTER, dir_ino %lu, name %s, namlen %u\n", dir->i_ino, name, namelen); 258 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,
262 /* OFFSET_CACHE */ 263 /* OFFSET_CACHE */
263 *res_page = NULL; 264 *res_page = NULL;
264 265
265 /* start = ei->i_dir_start_lookup; */ 266 start = ui->i_dir_start_lookup;
266 start = 0; 267
267 if (start >= npages) 268 if (start >= npages)
268 start = 0; 269 start = 0;
269 n = start; 270 n = start;
@@ -295,7 +296,7 @@ out:
295 296
296found: 297found:
297 *res_page = page; 298 *res_page = page;
298 /* ei->i_dir_start_lookup = n; */ 299 ui->i_dir_start_lookup = n;
299 return de; 300 return de;
300} 301}
301 302