diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 04:26:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 04:26:47 -0400 |
| commit | ab34c02afeafd047a831e6fe2a4dd875ce86bee0 (patch) | |
| tree | 833e385e8387e3d4d4531ade23c1d92fba8ed075 /fs/nilfs2/bmap.c | |
| parent | 7f3883962870dd28b5f2322ac44a9d03640ef448 (diff) | |
| parent | 6b81e14e645016597c81e71cd27ee5c57c3a3c36 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (36 commits)
nilfs2: eliminate sparse warning - "context imbalance"
nilfs2: eliminate sparse warnings - "symbol not declared"
nilfs2: get rid of bdi from nilfs object
nilfs2: change license of exported header file
nilfs2: add bdev freeze/thaw support
nilfs2: accept 64-bit checkpoint numbers in cp mount option
nilfs2: remove own inode allocator and destructor for metadata files
nilfs2: get rid of back pointer to writable sb instance
nilfs2: get rid of mi_nilfs back pointer to nilfs object
nilfs2: see state of root dentry for mount check of snapshots
nilfs2: use iget for all metadata files
nilfs2: get rid of GCDAT inode
nilfs2: add routines to redirect access to buffers of DAT file
nilfs2: add routines to roll back state of DAT file
nilfs2: add routines to save and restore bmap state
nilfs2: do not allocate nilfs_mdt_info structure to gc-inodes
nilfs2: allow nilfs_clear_inode to clear metadata file inodes
nilfs2: get rid of snapshot mount flag
nilfs2: simplify life cycle management of nilfs object
nilfs2: do not allocate multiple super block instances for a device
...
Diffstat (limited to 'fs/nilfs2/bmap.c')
| -rw-r--r-- | fs/nilfs2/bmap.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 3dbdc1d356bf..8b782b062baa 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c | |||
| @@ -533,18 +533,20 @@ void nilfs_bmap_init_gc(struct nilfs_bmap *bmap) | |||
| 533 | nilfs_btree_init_gc(bmap); | 533 | nilfs_btree_init_gc(bmap); |
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | void nilfs_bmap_init_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap) | 536 | void nilfs_bmap_save(const struct nilfs_bmap *bmap, |
| 537 | struct nilfs_bmap_store *store) | ||
| 537 | { | 538 | { |
| 538 | memcpy(gcbmap, bmap, sizeof(*bmap)); | 539 | memcpy(store->data, bmap->b_u.u_data, sizeof(store->data)); |
| 539 | init_rwsem(&gcbmap->b_sem); | 540 | store->last_allocated_key = bmap->b_last_allocated_key; |
| 540 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); | 541 | store->last_allocated_ptr = bmap->b_last_allocated_ptr; |
| 541 | gcbmap->b_inode = &NILFS_BMAP_I(gcbmap)->vfs_inode; | 542 | store->state = bmap->b_state; |
| 542 | } | 543 | } |
| 543 | 544 | ||
| 544 | void nilfs_bmap_commit_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap) | 545 | void nilfs_bmap_restore(struct nilfs_bmap *bmap, |
| 546 | const struct nilfs_bmap_store *store) | ||
| 545 | { | 547 | { |
| 546 | memcpy(bmap, gcbmap, sizeof(*bmap)); | 548 | memcpy(bmap->b_u.u_data, store->data, sizeof(store->data)); |
| 547 | init_rwsem(&bmap->b_sem); | 549 | bmap->b_last_allocated_key = store->last_allocated_key; |
| 548 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); | 550 | bmap->b_last_allocated_ptr = store->last_allocated_ptr; |
| 549 | bmap->b_inode = &NILFS_BMAP_I(bmap)->vfs_inode; | 551 | bmap->b_state = store->state; |
| 550 | } | 552 | } |
