summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/page.h
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-08-31 04:40:34 +0200
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-23 02:24:37 +0200
commitb1f6a4f294088b3fcf9ae67915ca550a1ded2819 (patch)
treee4eab590fddc20111138e97ee4d55f10af519c8c /fs/nilfs2/page.h
parentnilfs2: add routines to roll back state of DAT file (diff)
downloadlinux-b1f6a4f294088b3fcf9ae67915ca550a1ded2819.tar.xz
linux-b1f6a4f294088b3fcf9ae67915ca550a1ded2819.zip
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>
Diffstat (limited to 'fs/nilfs2/page.h')
-rw-r--r--fs/nilfs2/page.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nilfs2/page.h b/fs/nilfs2/page.h
index 6ec4f498fc2b..fb9e8a8a2038 100644
--- a/fs/nilfs2/page.h
+++ b/fs/nilfs2/page.h
@@ -35,12 +35,14 @@ enum {
BH_NILFS_Node,
BH_NILFS_Volatile,
BH_NILFS_Checked,
+ BH_NILFS_Redirected,
};
BUFFER_FNS(NILFS_Allocated, nilfs_allocated) /* nilfs private buffers */
BUFFER_FNS(NILFS_Node, nilfs_node) /* nilfs node buffers */
BUFFER_FNS(NILFS_Volatile, nilfs_volatile)
BUFFER_FNS(NILFS_Checked, nilfs_checked) /* buffer is verified */
+BUFFER_FNS(NILFS_Redirected, nilfs_redirected) /* redirected to a copy */
void nilfs_mark_buffer_dirty(struct buffer_head *bh);