mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-31 05:47:43 +03:00
fix last check-in: lv->size is in sectors
This commit is contained in:
parent
1c3c2df9e9
commit
4d2a8d8231
@ -285,7 +285,7 @@ struct logical_volume {
|
||||
int32_t major;
|
||||
int32_t minor;
|
||||
|
||||
uint64_t size;
|
||||
uint64_t size; /* Sectors */
|
||||
uint32_t le_count;
|
||||
|
||||
uint32_t origin_count;
|
||||
|
@ -294,7 +294,7 @@ static int lvchange_resync(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
log_very_verbose("Clearing log device %s", log_lv->name);
|
||||
if (!set_lv(cmd, log_lv, (size_t) log_lv->size, 0)) {
|
||||
if (!set_lv(cmd, log_lv, log_lv->size, 0)) {
|
||||
log_error("Unable to reset sync status for %s", lv->name);
|
||||
if (!deactivate_lv(cmd, log_lv))
|
||||
log_error("Failed to deactivate log LV after "
|
||||
|
@ -1188,8 +1188,8 @@ int generate_log_name_format(struct volume_group *vg __attribute((unused)),
|
||||
/*
|
||||
* Initialize the LV with 'value'.
|
||||
*/
|
||||
int set_lv(struct cmd_context *cmd, struct logical_volume *lv, size_t len,
|
||||
int value)
|
||||
int set_lv(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
uint64_t sectors, int value)
|
||||
{
|
||||
struct device *dev;
|
||||
char *name;
|
||||
@ -1222,7 +1222,8 @@ int set_lv(struct cmd_context *cmd, struct logical_volume *lv, size_t len,
|
||||
if (!dev_open_quiet(dev))
|
||||
return 0;
|
||||
|
||||
dev_set(dev, UINT64_C(0), len ?: (size_t) 4096, value);
|
||||
dev_set(dev, UINT64_C(0),
|
||||
sectors ? (size_t) sectors >> SECTOR_SHIFT : (size_t) 4096, value);
|
||||
dev_flush(dev);
|
||||
dev_close_immediate(dev);
|
||||
|
||||
@ -1337,7 +1338,7 @@ struct logical_volume *create_mirror_log(struct cmd_context *cmd,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (activation() && !set_lv(cmd, log_lv, (size_t) log_lv->size,
|
||||
if (activation() && !set_lv(cmd, log_lv, log_lv->size,
|
||||
in_sync ? -1 : 0)) {
|
||||
log_error("Aborting. Failed to wipe mirror log. "
|
||||
"Remove new LV and retry.");
|
||||
|
@ -101,7 +101,7 @@ struct logical_volume *create_mirror_log(struct cmd_context *cmd,
|
||||
const char *lv_name,
|
||||
int in_sync);
|
||||
|
||||
int set_lv(struct cmd_context *cmd, struct logical_volume *lv, size_t len,
|
||||
int value);
|
||||
int set_lv(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
uint64_t sectors, int value);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user