f2fs: add recovery routines for roll-forward
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Fri, 2 Nov 2012 08:13:32 +0000 (17:13 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 11 Dec 2012 04:43:42 +0000 (13:43 +0900)
commitd624c96fb3249e5d3dcf4e60a805e5e6b0dd7d91
tree69ad4c96d4c78d728cb2941a41f64737021e68cd
parent7bc0900347e069a1676d28ad6f98cafaf8cfd6e9
f2fs: add recovery routines for roll-forward

This adds roll-forward routines to recover fsynced data.

- F2FS uses basically roll-back model with checkpointing.

- In order to implement fsync(), there are two approaches as follows.

1. A roll-back model with checkpointing at every fsync()
 : This is a naive method, but suffers from very low performance.

2. A roll-forward model
 : F2FS adopts this model where all the fsynced data should be recovered, which
   were written after checkpointing was done. In order to figure out the data,
   F2FS keeps a "fsync" mark in direct node blocks. In addition, F2FS remains
   the location of next node block in each direct node block for reconstructing
   the chain of node blocks during the recovery.

- In order to enhance the performance, F2FS keeps a "dentry" mark also in direct
  node blocks. If this is set during the recovery, F2FS replays adding a dentry.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/recovery.c [new file with mode: 0644]