Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319481
b: refs/heads/master
c: f4b9036
h: refs/heads/master
i:
  319479: 22ab821
v: v3
  • Loading branch information
Joe Thornber authored and Alasdair G Kergon committed Jul 27, 2012
1 parent 0dbe60a commit 8c06f00
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d44c98aac540cdf3cb5385bc6ef8d56930c7d70
refs/heads/master: f4b90369d3a9ffe0f48f373c566578c142e95bf2
12 changes: 11 additions & 1 deletion trunk/drivers/md/persistent-data/dm-space-map-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ static int sm_ll_init(struct ll_disk *ll, struct dm_transaction_manager *tm)
ll->nr_blocks = 0;
ll->bitmap_root = 0;
ll->ref_count_root = 0;
ll->bitmap_index_changed = false;

return 0;
}
Expand Down Expand Up @@ -476,7 +477,15 @@ int sm_ll_dec(struct ll_disk *ll, dm_block_t b, enum allocation_event *ev)

int sm_ll_commit(struct ll_disk *ll)
{
return ll->commit(ll);
int r = 0;

if (ll->bitmap_index_changed) {
r = ll->commit(ll);
if (!r)
ll->bitmap_index_changed = false;
}

return r;
}

/*----------------------------------------------------------------*/
Expand All @@ -491,6 +500,7 @@ static int metadata_ll_load_ie(struct ll_disk *ll, dm_block_t index,
static int metadata_ll_save_ie(struct ll_disk *ll, dm_block_t index,
struct disk_index_entry *ie)
{
ll->bitmap_index_changed = true;
memcpy(ll->mi_le.index + index, ie, sizeof(*ie));
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/md/persistent-data/dm-space-map-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct ll_disk {
open_index_fn open_index;
max_index_entries_fn max_entries;
commit_fn commit;
bool bitmap_index_changed:1;
};

struct disk_sm_root {
Expand Down

0 comments on commit 8c06f00

Please sign in to comment.