mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
dmeventd: code mode _get_device_status
Move _get_device_status() in code. Use dm_task_no_flush() function when reading status. (e.g. none blocking for thins pool)
This commit is contained in:
parent
15dbd4b56a
commit
81e9ab3156
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.110 -
|
Version 1.02.110 -
|
||||||
======================================
|
======================================
|
||||||
|
Dmeventd read device status with 'noflush'.
|
||||||
Dmeventd closes control device when no device is monitored.
|
Dmeventd closes control device when no device is monitored.
|
||||||
Thin plugin for dmeventd improved percentage usage.
|
Thin plugin for dmeventd improved percentage usage.
|
||||||
Snapshot plugin for dmeventd improved percentage usage.
|
Snapshot plugin for dmeventd improved percentage usage.
|
||||||
|
@ -570,6 +570,30 @@ fail:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct dm_task *_get_device_status(struct thread_status *ts)
|
||||||
|
{
|
||||||
|
struct dm_task *dmt = dm_task_create(DM_DEVICE_STATUS);
|
||||||
|
|
||||||
|
if (!dmt)
|
||||||
|
return_NULL;
|
||||||
|
|
||||||
|
if (!dm_task_set_uuid(dmt, ts->device.uuid)) {
|
||||||
|
dm_task_destroy(dmt);
|
||||||
|
return_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Non-blocking status read */
|
||||||
|
if (!dm_task_no_flush(dmt))
|
||||||
|
log_warn("WARNING: Can't set no_flush for dm status.");
|
||||||
|
|
||||||
|
if (!dm_task_run(dmt)) {
|
||||||
|
dm_task_destroy(dmt);
|
||||||
|
return_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dmt;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find an existing thread for a device.
|
* Find an existing thread for a device.
|
||||||
*
|
*
|
||||||
@ -886,26 +910,6 @@ static void _monitor_unregister(void *arg)
|
|||||||
_unlock_mutex();
|
_unlock_mutex();
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dm_task *_get_device_status(struct thread_status *ts)
|
|
||||||
{
|
|
||||||
struct dm_task *dmt = dm_task_create(DM_DEVICE_STATUS);
|
|
||||||
|
|
||||||
if (!dmt)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (!dm_task_set_uuid(dmt, ts->device.uuid)) {
|
|
||||||
dm_task_destroy(dmt);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dm_task_run(dmt)) {
|
|
||||||
dm_task_destroy(dmt);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dmt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Device monitoring thread. */
|
/* Device monitoring thread. */
|
||||||
static void *_monitor_thread(void *arg)
|
static void *_monitor_thread(void *arg)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user