nilfs2: add routines to redirect access to buffers of DAT file
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tue, 31 Aug 2010 02:40:34 +0000 (11:40 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sat, 23 Oct 2010 00:24:37 +0000 (09:24 +0900)
commitb1f6a4f294088b3fcf9ae67915ca550a1ded2819
treee4eab590fddc20111138e97ee4d55f10af519c8c
parentebdfed4dc59d177cf26013a0c9b8ee9652e9a140
nilfs2: add routines to redirect access to buffers of DAT file

During garbage collection (GC), DAT file, which converts virtual block
number to real block number, may return disk block number that is not
yet written to the device.

To avoid access to unwritten blocks, the current implementation stores
changes to the caches of GCDAT during GC and atomically commit the
changes into the DAT file after they are written to the device.

This patch, instead, adds a function that makes a copy of specified
buffer and stores it in nilfs_shadow_map, and a function to get the
backup copy as needed (nilfs_mdt_freeze_buffer and
nilfs_mdt_get_frozen_buffer respectively).

Before DAT changes block number in an entry block, it makes a copy and
redirect access to the buffer so that address conversion function
(i.e. nilfs_dat_translate) refers to the old address saved in the
copy.

This patch gives requisites for such redirection.

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