struct rw_semaphore root_lock;
uint32_t time;
- int need_commit;
dm_block_t root;
dm_block_t details_root;
struct list_head thin_devices;
init_rwsem(&pmd->root_lock);
pmd->time = 0;
- pmd->need_commit = 0;
pmd->details_root = 0;
pmd->trans_id = 0;
pmd->flags = 0;
struct thin_disk_superblock *disk_super;
struct dm_block *sblock;
- /*
- * __maybe_commit_transaction() resets these
- */
- WARN_ON(pmd->need_commit);
-
/*
* We re-read the superblock every time. Shouldn't need to do this
* really.
list_del(&td->list);
kfree(td);
}
-
- pmd->need_commit = 1;
}
return 0;
if (r < 0)
return r;
- if (!pmd->need_commit)
- return r;
-
r = dm_sm_commit(pmd->data_sm);
if (r < 0)
return r;
if (r < 0)
goto out_locked;
- r = dm_tm_commit(pmd->tm, sblock);
- if (!r)
- pmd->need_commit = 0;
-
- return r;
+ return dm_tm_commit(pmd->tm, sblock);
out_locked:
dm_bm_unlock(sblock);
}
pmd->flags = 0;
- pmd->need_commit = 1;
r = dm_pool_commit_metadata(pmd);
if (r < 0) {
DMERR("%s: dm_pool_commit_metadata() failed, error = %d",
if (r)
return r;
- pmd->need_commit = 1;
-
return 0;
}
}
pmd->trans_id = new_id;
- pmd->need_commit = 1;
up_write(&pmd->root_lock);
return 0;
dm_tm_dec(pmd->tm, held_root);
dm_tm_unlock(pmd->tm, copy);
- pmd->need_commit = 1;
-
return -EBUSY;
}
&sb_validator, &sblock);
if (r) {
dm_tm_dec(pmd->tm, held_root);
- pmd->need_commit = 1;
return r;
}
disk_super = dm_block_data(sblock);
disk_super->held_root = cpu_to_le64(held_root);
dm_bm_unlock(sblock);
-
- pmd->need_commit = 1;
-
return 0;
}
disk_super = dm_block_data(sblock);
held_root = le64_to_cpu(disk_super->held_root);
disk_super->held_root = cpu_to_le64(0);
- pmd->need_commit = 1;
dm_bm_unlock(sblock);
struct dm_pool_metadata *pmd = td->pmd;
dm_block_t keys[2] = { td->id, block };
- pmd->need_commit = 1;
value = cpu_to_le64(pack_block_time(data_block, pmd->time));
__dm_bless_for_disk(&value);
td->mapped_blocks--;
td->changed = 1;
- pmd->need_commit = 1;
return 0;
}
int r;
down_write(&pmd->root_lock);
-
r = dm_sm_new_block(pmd->data_sm, result);
- pmd->need_commit = 1;
-
up_write(&pmd->root_lock);
return r;
return -EINVAL;
}
- r = dm_sm_extend(pmd->data_sm, new_count - old_count);
- if (!r)
- pmd->need_commit = 1;
-
- return r;
+ return dm_sm_extend(pmd->data_sm, new_count - old_count);
}
int dm_pool_resize_data_dev(struct dm_pool_metadata *pmd, dm_block_t new_count)