1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-11 09:18:25 +03:00

Rename origin_only to more generic use_layer flag

Since now we have more layered devices i.e. thin volumes - support
selection of layer via flag.
This commit is contained in:
Zdenek Kabelac 2012-01-25 13:10:26 +00:00
parent 93903e1edf
commit ec2012f736
3 changed files with 18 additions and 15 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.89 - Version 2.02.89 -
================================== ==================================
Rename origin_only parameter to more generic flag use_layer for lv_info().
Thin pools have segment fields thin_count, zero, transaction_id. Thin pools have segment fields thin_count, zero, transaction_id.
Each new created LV volume has creation lv_time and lv_host. Each new created LV volume has creation lv_time and lv_host.
Print data_percent and metadata_percent for verbose lvs. Print data_percent and metadata_percent for verbose lvs.

View File

@ -151,13 +151,12 @@ int lvm_dm_prefix_check(const char *sysfs_dir, int major, int minor, const char
{ {
return 0; return 0;
} }
int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned origin_only, int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
struct lvinfo *info, int with_open_count, int with_read_ahead) struct lvinfo *info, int with_open_count, int with_read_ahead)
{ {
return 0; return 0;
} }
int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
unsigned origin_only,
struct lvinfo *info, int with_open_count, int with_read_ahead) struct lvinfo *info, int with_open_count, int with_read_ahead)
{ {
return 0; return 0;
@ -532,10 +531,11 @@ int target_present(struct cmd_context *cmd, const char *target_name,
/* /*
* Returns 1 if info structure populated, else 0 on failure. * Returns 1 if info structure populated, else 0 on failure.
*/ */
int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned origin_only, int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
struct lvinfo *info, int with_open_count, int with_read_ahead) struct lvinfo *info, int with_open_count, int with_read_ahead)
{ {
struct dm_info dminfo; struct dm_info dminfo;
const char *layer;
if (!activation()) if (!activation())
return 0; return 0;
@ -552,7 +552,14 @@ int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned o
fs_unlock(); /* For non clustered - wait if there are non-delete ops */ fs_unlock(); /* For non clustered - wait if there are non-delete ops */
} }
if (!dev_manager_info(lv->vg->cmd->mem, lv, (lv_is_origin(lv) && origin_only) ? "real" : NULL, with_open_count, if (use_layer && lv_is_thin_pool(lv))
layer = "tpool";
else if (use_layer && lv_is_origin(lv))
layer = "real";
else
layer = NULL;
if (!dev_manager_info(lv->vg->cmd->mem, lv, layer, with_open_count,
with_read_ahead, &dminfo, &info->read_ahead)) with_read_ahead, &dminfo, &info->read_ahead))
return_0; return_0;
@ -568,8 +575,7 @@ int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, unsigned o
return 1; return 1;
} }
int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
unsigned origin_only,
struct lvinfo *info, int with_open_count, int with_read_ahead) struct lvinfo *info, int with_open_count, int with_read_ahead)
{ {
int r; int r;
@ -578,10 +584,7 @@ int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s,
if (!(lv = lv_from_lvid(cmd, lvid_s, 0))) if (!(lv = lv_from_lvid(cmd, lvid_s, 0)))
return 0; return 0;
if (!lv_is_origin(lv)) r = lv_info(cmd, lv, use_layer, info, with_open_count, with_read_ahead);
origin_only = 0;
r = lv_info(cmd, lv, origin_only, info, with_open_count, with_read_ahead);
release_vg(lv->vg); release_vg(lv->vg);
return r; return r;

View File

@ -79,10 +79,9 @@ int lv_mknodes(struct cmd_context *cmd, const struct logical_volume *lv);
/* /*
* Returns 1 if info structure has been populated, else 0. * Returns 1 if info structure has been populated, else 0.
*/ */
int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_layer,
unsigned origin_only, struct lvinfo *info, struct lvinfo *info, int with_open_count, int with_read_ahead);
int with_open_count, int with_read_ahead); int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer,
int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only,
struct lvinfo *info, int with_open_count, int with_read_ahead); struct lvinfo *info, int with_open_count, int with_read_ahead);
int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv, int lv_check_not_in_use(struct cmd_context *cmd, struct logical_volume *lv,