diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-08-30 23:42:18 +0900 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-10-23 09:24:37 +0900 |
commit | a8070dd365dd995f6139a2fc3aeee10159bdcc45 (patch) | |
tree | 11a16157b10ed0b6d3f773ded6bd5b82c3f8c4bc /fs/nilfs2/bmap.h | |
parent | adbb39b5485b72dca963a2bc9b1b22bfc19d4967 (diff) | |
download | kernel_goldelico_gta04-a8070dd365dd995f6139a2fc3aeee10159bdcc45.zip kernel_goldelico_gta04-a8070dd365dd995f6139a2fc3aeee10159bdcc45.tar.gz kernel_goldelico_gta04-a8070dd365dd995f6139a2fc3aeee10159bdcc45.tar.bz2 |
nilfs2: add routines to save and restore bmap state
This adds routines to save and restore the state of bmap structure.
The bmap state is stored in a given nilfs_bmap_store object.
These routines will be used to roll back the state of dat inode
without using gcdat inode.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/bmap.h')
-rw-r--r-- | fs/nilfs2/bmap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nilfs2/bmap.h b/fs/nilfs2/bmap.h index a20569b..5f3339e 100644 --- a/fs/nilfs2/bmap.h +++ b/fs/nilfs2/bmap.h @@ -135,6 +135,12 @@ struct nilfs_bmap { /* state */ #define NILFS_BMAP_DIRTY 0x00000001 +struct nilfs_bmap_store { + __le64 data[NILFS_BMAP_SIZE / sizeof(__le64)]; + __u64 last_allocated_key; + __u64 last_allocated_ptr; + int state; +}; int nilfs_bmap_test_and_clear_dirty(struct nilfs_bmap *); int nilfs_bmap_read(struct nilfs_bmap *, struct nilfs_inode *); @@ -156,6 +162,8 @@ void nilfs_bmap_init_gc(struct nilfs_bmap *); void nilfs_bmap_init_gcdat(struct nilfs_bmap *, struct nilfs_bmap *); void nilfs_bmap_commit_gcdat(struct nilfs_bmap *, struct nilfs_bmap *); +void nilfs_bmap_save(const struct nilfs_bmap *, struct nilfs_bmap_store *); +void nilfs_bmap_restore(struct nilfs_bmap *, const struct nilfs_bmap_store *); static inline int nilfs_bmap_lookup(struct nilfs_bmap *bmap, __u64 key, __u64 *ptr) |