diff options
Diffstat (limited to 'fs/nilfs2/bmap.c')
-rw-r--r-- | fs/nilfs2/bmap.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 3dbdc1d356bf..00244402d59e 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c | |||
@@ -548,3 +548,21 @@ void nilfs_bmap_commit_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap) | |||
548 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); | 548 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); |
549 | bmap->b_inode = &NILFS_BMAP_I(bmap)->vfs_inode; | 549 | bmap->b_inode = &NILFS_BMAP_I(bmap)->vfs_inode; |
550 | } | 550 | } |
551 | |||
552 | void nilfs_bmap_save(const struct nilfs_bmap *bmap, | ||
553 | struct nilfs_bmap_store *store) | ||
554 | { | ||
555 | memcpy(store->data, bmap->b_u.u_data, sizeof(store->data)); | ||
556 | store->last_allocated_key = bmap->b_last_allocated_key; | ||
557 | store->last_allocated_ptr = bmap->b_last_allocated_ptr; | ||
558 | store->state = bmap->b_state; | ||
559 | } | ||
560 | |||
561 | void nilfs_bmap_restore(struct nilfs_bmap *bmap, | ||
562 | const struct nilfs_bmap_store *store) | ||
563 | { | ||
564 | memcpy(bmap->b_u.u_data, store->data, sizeof(store->data)); | ||
565 | bmap->b_last_allocated_key = store->last_allocated_key; | ||
566 | bmap->b_last_allocated_ptr = store->last_allocated_ptr; | ||
567 | bmap->b_state = store->state; | ||
568 | } | ||