[Ocfs2-tools-devel] [PATCH 10/11] libocfs2: Improve performance of ocfs2_load_allocator()

Sunil Mushran sunil.mushran at oracle.com
Thu Sep 22 19:04:38 PDT 2011


ocfs2_load_allocator() calls ocfs2_cache_chain_allocator_blocks()
to preread the chained groups. Its impact on fsck performance is
negligible.

However it is expected to have a big impact on other tools that load
the allocators. Especially mkfs. But for that we have to first bump
up its cache size from a default of 8MB.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 libocfs2/alloc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libocfs2/alloc.c b/libocfs2/alloc.c
index ca1a13a..1cd21c6 100644
--- a/libocfs2/alloc.c
+++ b/libocfs2/alloc.c
@@ -85,6 +85,9 @@ static errcode_t ocfs2_load_allocator(ocfs2_filesys *fs,
 		ret = ocfs2_read_cached_inode(fs, blkno, alloc_cinode);
 		if (ret)
 			return ret;
+		/* Ignore error */
+		ocfs2_cache_chain_allocator_blocks(fs,
+						   (*alloc_cinode)->ci_inode);
 	}
 
 	if (!(*alloc_cinode)->ci_chains) {
-- 
1.7.4.1




More information about the Ocfs2-tools-devel mailing list