1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-04-01 18:50:41 +03:00

thin: use noflush for obtaining transaction_id

Do not flush thin pool data, when reading transation_id status.
This commit is contained in:
Zdenek Kabelac 2013-01-17 10:54:41 +01:00
parent 153ce89af3
commit a4870c79ca
5 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Avoid flushing thin pool when quering for transaction_id.
Add internal function lv_layer() to obtain layer name for LV.
Report partial and in-sync RAID attribute based on kernel status
Fix blkdeactivate to handle nested mountpoints and mangled mount paths.

View File

@ -888,7 +888,7 @@ int lv_thin_pool_transaction_id(const struct logical_volume *lv,
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
return_0;
if (!(r = dev_manager_thin_pool_status(dm, lv, &status)))
if (!(r = dev_manager_thin_pool_status(dm, lv, &status, 1)))
stack;
else
*transaction_id = status->transaction_id;

View File

@ -1124,7 +1124,8 @@ static int _belong_to_vg(const char *vgname, const char *name)
int dev_manager_thin_pool_status(struct dev_manager *dm,
const struct logical_volume *lv,
struct dm_status_thin_pool **status)
struct dm_status_thin_pool **status,
int noflush)
{
const char *dlid;
struct dm_task *dmt;
@ -1146,6 +1147,9 @@ int dev_manager_thin_pool_status(struct dev_manager *dm,
if (!dm_task_no_open_count(dmt))
log_error("Failed to disable open_count.");
if (noflush && !dm_task_no_flush(dmt))
log_warn("Can't set no_flush.");
if (!dm_task_run(dmt))
goto_out;

View File

@ -59,7 +59,8 @@ int dev_manager_raid_status(struct dev_manager *dm,
struct dm_status_raid **status);
int dev_manager_thin_pool_status(struct dev_manager *dm,
const struct logical_volume *lv,
struct dm_status_thin_pool **status);
struct dm_status_thin_pool **status,
int noflush);
int dev_manager_thin_pool_percent(struct dev_manager *dm,
const struct logical_volume *lv,
int metadata, percent_t *percent);

View File

@ -1360,6 +1360,9 @@ static int _thin_pool_status_transaction_id(struct dm_tree_node *dnode, uint64_t
goto out;
}
if (!dm_task_no_flush(dmt))
log_warn("Can't set no_flush flag."); /* Non fatal */
if (!dm_task_run(dmt))
goto_out;