mirror of
git://sourceware.org/git/lvm2.git
synced 2024-10-29 04:55:51 +03:00
dmeventd: drop changing logging
As we now use 'unified' logging macro system - we no longer need to protect from change of logging function pointer - it's set once at the start of dmeventd and not change anymore (as lvm2 library no longer interferers here).
This commit is contained in:
parent
42a9c8b4a6
commit
13086c2523
@ -648,7 +648,6 @@ static sigset_t _unblock_sigalrm(void)
|
|||||||
/* Wait on a device until an event occurs. */
|
/* Wait on a device until an event occurs. */
|
||||||
static int _event_wait(struct thread_status *thread, struct dm_task **task)
|
static int _event_wait(struct thread_status *thread, struct dm_task **task)
|
||||||
{
|
{
|
||||||
static unsigned _in_event_counter = 0;
|
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
int ret = DM_WAIT_RETRY;
|
int ret = DM_WAIT_RETRY;
|
||||||
struct dm_task *dmt;
|
struct dm_task *dmt;
|
||||||
@ -667,16 +666,11 @@ static int _event_wait(struct thread_status *thread, struct dm_task **task)
|
|||||||
!dm_task_set_event_nr(dmt, thread->event_nr))
|
!dm_task_set_event_nr(dmt, thread->event_nr))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
_lock_mutex();
|
|
||||||
/*
|
/*
|
||||||
* Check if there are already some waiting events,
|
* Check if there are already some waiting events,
|
||||||
* in this case the logging is unmodified.
|
* in this case the logging is unmodified.
|
||||||
* TODO: audit libdm thread usage
|
* TODO: audit libdm thread usage
|
||||||
*/
|
*/
|
||||||
if (!_in_event_counter++)
|
|
||||||
dm_log_init(_dmeventd_log);
|
|
||||||
_unlock_mutex();
|
|
||||||
|
|
||||||
DEBUGLOG("Starting waitevent task for %s", thread->device.uuid);
|
DEBUGLOG("Starting waitevent task for %s", thread->device.uuid);
|
||||||
/*
|
/*
|
||||||
* This is so that you can break out of waiting on an event,
|
* This is so that you can break out of waiting on an event,
|
||||||
@ -708,10 +702,6 @@ static int _event_wait(struct thread_status *thread, struct dm_task **task)
|
|||||||
DEBUGLOG("Completed waitevent task for %s", thread->device.uuid);
|
DEBUGLOG("Completed waitevent task for %s", thread->device.uuid);
|
||||||
|
|
||||||
pthread_sigmask(SIG_SETMASK, &set, NULL);
|
pthread_sigmask(SIG_SETMASK, &set, NULL);
|
||||||
_lock_mutex();
|
|
||||||
if (--_in_event_counter == 0)
|
|
||||||
dm_log_init(NULL);
|
|
||||||
_unlock_mutex();
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (ret == DM_WAIT_FATAL || ret == DM_WAIT_RETRY) {
|
if (ret == DM_WAIT_FATAL || ret == DM_WAIT_RETRY) {
|
||||||
|
Loading…
Reference in New Issue
Block a user