]> bbs.cooldavid.org Git - net-next-2.6.git/commit
nilfs2: add routines to roll back state of DAT file
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Mon, 6 Sep 2010 03:05:43 +0000 (12:05 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sat, 23 Oct 2010 00:24:37 +0000 (09:24 +0900)
commitebdfed4dc59d177cf26013a0c9b8ee9652e9a140
tree6ef90f068ae41c55234181c93d8e30a303126c43
parenta8070dd365dd995f6139a2fc3aeee10159bdcc45
nilfs2: add routines to roll back state of DAT file

This adds optional function to metadata files which makes a copy of
bmap, page caches, and b-tree node cache, and rolls back to the copy
as needed.

This enhancement is intended to displace gcdat inode that provides a
similar function in a different way.

In this patch, nilfs_shadow_map structure is added to store a copy of
the foregoing states.  nilfs_mdt_setup_shadow_map relates this
structure to a metadata file.  And, nilfs_mdt_save_to_shadow_map() and
nilfs_mdt_restore_from_shadow_map() provides save and restore
functions respectively.  Finally, nilfs_mdt_clear_shadow_map() clears
states of nilfs_shadow_map.

The copy of b-tree node cache and page cache is made by duplicating
only dirty pages into corresponding caches in nilfs_shadow_map.  Their
restoration is done by clearing dirty pages from original caches and
by copying dirty pages back from nilfs_shadow_map.

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