nilfs2: add cache framework for persistent object allocator
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sat, 14 Nov 2009 06:54:27 +0000 (15:54 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fri, 20 Nov 2009 01:05:50 +0000 (10:05 +0900)
commitdb38d5ad323362bfca118b52fe5906f97a69fb45
tree11940fedf0eb0ff80527094bd435ec89641f8adc
parent141bbdba9c2c1592d56b019277774099a5412aea
nilfs2: add cache framework for persistent object allocator

This adds setup and cleanup routines of the persistent object
allocator cache.

According to ftrace analyses, accessing buffers of the DAT file
suffers indispensable overhead many times.  To mitigate the overhead,
This introduce cache framework for the persistent object allocator
(palloc) which the DAT file and ifile are using.

struct nilfs_palloc_cache represents the cache object per metadata
file using palloc.

The cache is initialized through nilfs_palloc_setup_cache() and
destroyed by nilfs_palloc_destroy_cache(); callers of the former
function will be added to individual allocators of DAT and ifile on
successive patches.

nilfs_palloc_destroy_cache() will be called from nilfs_mdt_destroy()
if the cache is attached to a metadata file.  A companion function
nilfs_palloc_clear_cache() is provided to allow releasing buffer head
references independently with the cleanup task.  This adjunctive
function will be used before invalidating pages of metadata file with
the cache.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/alloc.c
fs/nilfs2/alloc.h
fs/nilfs2/mdt.c
fs/nilfs2/mdt.h