+ ufs-little-directory-lookup-optimization.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     ufs: little directory lookup optimization

has been added to the -mm tree.  Its filename is

     ufs-little-directory-lookup-optimization.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ufs: little directory lookup optimization
From: Evgeniy Dushistov <dushistov@xxxxxxx>


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@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/ufs/dir.c             |    7 ++++---
 fs/ufs/ialloc.c          |    1 +
 fs/ufs/inode.c           |    4 ++--
 include/linux/ufs_fs_i.h |    1 +
 4 files changed, 8 insertions(+), 5 deletions(-)

diff -puN fs/ufs/dir.c~ufs-little-directory-lookup-optimization fs/ufs/dir.c
--- devel/fs/ufs/dir.c~ufs-little-directory-lookup-optimization	2006-06-03 16:38:50.000000000 -0700
+++ devel-akpm/fs/ufs/dir.c	2006-06-03 16:38:50.000000000 -0700
@@ -252,6 +252,7 @@ struct ufs_dir_entry *ufs_find_entry(str
 	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(str
 	/* 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;
 }
 
diff -puN fs/ufs/ialloc.c~ufs-little-directory-lookup-optimization fs/ufs/ialloc.c
--- devel/fs/ufs/ialloc.c~ufs-little-directory-lookup-optimization	2006-06-03 16:38:50.000000000 -0700
+++ devel-akpm/fs/ufs/ialloc.c	2006-06-03 16:38:50.000000000 -0700
@@ -264,6 +264,7 @@ cg_found:
 	ufsi->i_shadow = 0;
 	ufsi->i_osync = 0;
 	ufsi->i_oeftflag = 0;
+	ufsi->i_dir_start_lookup = 0;
 	memset(&ufsi->i_u1, 0, sizeof(ufsi->i_u1));
 
 	insert_inode_hash(inode);
diff -puN fs/ufs/inode.c~ufs-little-directory-lookup-optimization fs/ufs/inode.c
--- devel/fs/ufs/inode.c~ufs-little-directory-lookup-optimization	2006-06-03 16:38:50.000000000 -0700
+++ devel-akpm/fs/ufs/inode.c	2006-06-03 16:38:50.000000000 -0700
@@ -628,12 +628,12 @@ void ufs_read_inode (struct inode * inod
 	ufsi->i_shadow = fs32_to_cpu(sb, ufs_inode->ui_u3.ui_sun.ui_shadow);
 	ufsi->i_oeftflag = fs32_to_cpu(sb, ufs_inode->ui_u3.ui_sun.ui_oeftflag);
 	ufsi->i_lastfrag = (inode->i_size + uspi->s_fsize - 1) >> uspi->s_fshift;
+	ufsi->i_dir_start_lookup = 0;
 	
 	if (S_ISCHR(mode) || S_ISBLK(mode) || inode->i_blocks) {
 		for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
 			ufsi->i_u1.i_data[i] = ufs_inode->ui_u2.ui_addr.ui_db[i];
-	}
-	else {
+	} else {
 		for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
 			ufsi->i_u1.i_symlink[i] = ufs_inode->ui_u2.ui_symlink[i];
 	}
diff -puN include/linux/ufs_fs_i.h~ufs-little-directory-lookup-optimization include/linux/ufs_fs_i.h
--- devel/include/linux/ufs_fs_i.h~ufs-little-directory-lookup-optimization	2006-06-03 16:38:50.000000000 -0700
+++ devel-akpm/include/linux/ufs_fs_i.h	2006-06-03 16:38:50.000000000 -0700
@@ -27,6 +27,7 @@ struct ufs_inode_info {
 	__u32	i_oeftflag;
 	__u16	i_osync;
 	__u32	i_lastfrag;
+	__u32   i_dir_start_lookup;
 	struct inode vfs_inode;
 };
 
_

Patches currently in -mm which might be from dushistov@xxxxxxx are

ufs-ufs_trunc_indirect-infinite-cycle.patch
ufs-right-block-allocation.patch
ufs-change-block-number-on-the-fly.patch
ufs-directory-and-page-cache-install-aops.patch
ufs-directory-and-page-cache-from-blocks-to-pages.patch
ufs-wrong-type-cast.patch
ufs-not-usual-amounts-of-fragments-per-block.patch
ufs-unmark-config_ufs_fs_write-as-broken-mm-tree.patch
ufs-easy-debug.patch
ufs-little-directory-lookup-optimization.patch
ufs-i_blocks-wrong-count.patch
ufs-unlock_super-without-lock.patch
ufs-zero-metadata.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux