mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +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. */
|
||||
static int _event_wait(struct thread_status *thread, struct dm_task **task)
|
||||
{
|
||||
static unsigned _in_event_counter = 0;
|
||||
sigset_t set;
|
||||
int ret = DM_WAIT_RETRY;
|
||||
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))
|
||||
goto out;
|
||||
|
||||
_lock_mutex();
|
||||
/*
|
||||
* Check if there are already some waiting events,
|
||||
* in this case the logging is unmodified.
|
||||
* 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);
|
||||
/*
|
||||
* 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);
|
||||
|
||||
pthread_sigmask(SIG_SETMASK, &set, NULL);
|
||||
_lock_mutex();
|
||||
if (--_in_event_counter == 0)
|
||||
dm_log_init(NULL);
|
||||
_unlock_mutex();
|
||||
|
||||
out:
|
||||
if (ret == DM_WAIT_FATAL || ret == DM_WAIT_RETRY) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user