mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: update pool_is_active
Change it to take LV and move it to exported header - seems to be a better fit for usability from tools/ directory.
This commit is contained in:
parent
c984d8fbab
commit
7910b6c0ba
@ -566,6 +566,7 @@ int lv_rename_update(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
|
||||
uint32_t extent_size);
|
||||
|
||||
int pool_is_active(const struct logical_volume *pool_lv);
|
||||
int update_pool_lv(struct logical_volume *lv, int activate);
|
||||
int get_pool_discards(const char *str, thin_discards_t *discards);
|
||||
const char *get_pool_discards_name(thin_discards_t discards);
|
||||
|
@ -472,7 +472,6 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type,
|
||||
int auto_increment);
|
||||
int pool_has_message(const struct lv_segment *seg,
|
||||
const struct logical_volume *lv, uint32_t device_id);
|
||||
int pool_is_active(const struct lv_segment *pool_seg);
|
||||
int pool_below_threshold(const struct lv_segment *pool_seg);
|
||||
int extend_pool(struct logical_volume *lv, const struct segment_type *segtype,
|
||||
struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size);
|
||||
|
@ -234,13 +234,12 @@ int pool_has_message(const struct lv_segment *seg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pool_is_active(const struct lv_segment *pool_seg)
|
||||
int pool_is_active(const struct logical_volume *lv)
|
||||
{
|
||||
struct lvinfo info;
|
||||
const struct seg_list *sl;
|
||||
const struct logical_volume *lv = pool_seg->lv;
|
||||
|
||||
if (!seg_is_thin_pool(pool_seg)) {
|
||||
if (!lv_is_thin_pool(lv)) {
|
||||
log_error(INTERNAL_ERROR "LV %s is not pool.", lv->name);
|
||||
return 0;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ static int lvchange_pool_update(struct cmd_context *cmd,
|
||||
if (discards != first_seg(lv)->discards) {
|
||||
if (((discards == THIN_DISCARDS_IGNORE) ||
|
||||
(first_seg(lv)->discards == THIN_DISCARDS_IGNORE)) &&
|
||||
pool_is_active(first_seg(lv)))
|
||||
pool_is_active(lv))
|
||||
log_error("Cannot change discards state for active "
|
||||
"pool volume \"%s\".", lv->name);
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user