1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

refactor: remove static modifier for lv_raid_image_in_sync and lv_raid_healthy fn

...to make use of it in other parts of the code.
This commit is contained in:
Peter Rajnoha 2014-07-01 09:56:03 +02:00
parent 9d2c445d0a
commit a4734354ce
2 changed files with 9 additions and 6 deletions

View File

@ -472,7 +472,7 @@ uint64_t lv_size(const struct logical_volume *lv)
return lv->size;
}
static int _lv_mimage_in_sync(const struct logical_volume *lv)
int lv_mirror_image_in_sync(const struct logical_volume *lv)
{
dm_percent_t percent;
struct lv_segment *seg = first_seg(lv);
@ -491,7 +491,7 @@ static int _lv_mimage_in_sync(const struct logical_volume *lv)
return (percent == DM_PERCENT_100) ? 1 : 0;
}
static int _lv_raid_image_in_sync(const struct logical_volume *lv)
int lv_raid_image_in_sync(const struct logical_volume *lv)
{
unsigned s;
dm_percent_t percent;
@ -555,7 +555,7 @@ static int _lv_raid_image_in_sync(const struct logical_volume *lv)
*
* Returns: 1 if healthy, 0 if device is not health
*/
static int _lv_raid_healthy(const struct logical_volume *lv)
int lv_raid_healthy(const struct logical_volume *lv)
{
unsigned s;
char *raid_health;
@ -662,14 +662,14 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
else if (lv_is_thin_pool_data(lv))
repstr[0] = 'T';
else if (lv->status & MIRROR_IMAGE)
repstr[0] = (_lv_mimage_in_sync(lv)) ? 'i' : 'I';
repstr[0] = (lv_mirror_image_in_sync(lv)) ? 'i' : 'I';
else if (lv->status & RAID_IMAGE)
/*
* Visible RAID_IMAGES are sub-LVs that have been exposed for
* top-level use by being split from the RAID array with
* '--splitmirrors 1 --trackchanges'. They always report 'I'.
*/
repstr[0] = (!lv_is_visible(lv) && _lv_raid_image_in_sync(lv)) ?
repstr[0] = (!lv_is_visible(lv) && lv_raid_image_in_sync(lv)) ?
'i' : 'I';
else if (lv->status & MIRROR_LOG)
repstr[0] = 'l';
@ -768,7 +768,7 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
uint64_t n;
if (!activation())
repstr[8] = 'X'; /* Unknown */
else if (!_lv_raid_healthy(lv))
else if (!lv_raid_healthy(lv))
repstr[8] = 'r'; /* RAID needs 'r'efresh */
else if (lv->status & RAID) {
if (lv_raid_mismatch_count(lv, &n) && n)

View File

@ -98,4 +98,7 @@ const struct logical_volume *lv_lock_holder(const struct logical_volume *lv);
struct logical_volume *lv_ondisk(struct logical_volume *lv);
struct profile *lv_config_profile(const struct logical_volume *lv);
char *lv_profile_dup(struct dm_pool *mem, const struct logical_volume *lv);
int lv_mirror_image_in_sync(const struct logical_volume *lv);
int lv_raid_image_in_sync(const struct logical_volume *lv);
int lv_raid_healthy(const struct logical_volume *lv);
#endif /* _LVM_LV_H */