]> Git Repo - linux.git/blobdiff - drivers/md/persistent-data/dm-space-map-common.c
mmc: omap_hsmmc: consolidate error report handling of HSMMC IRQ
[linux.git] / drivers / md / persistent-data / dm-space-map-common.c
index ff3beed6ad2d93769e475539ecd60d29ffdfaf22..d77602d63c83f8b98e341dd07c1dd50c397986e4 100644 (file)
@@ -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;
 }
@@ -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;
 }
 
 /*----------------------------------------------------------------*/
@@ -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;
 }
This page took 0.032918 seconds and 4 git commands to generate.