summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2014-11-04 16:55:42 +0000
committerAlasdair G Kergon <agk@redhat.com>2014-11-04 16:55:42 +0000
commit6b25faa218fc5cd1601e5418ce1481400386ecce (patch)
treeaba6ca47e08ee5931c3e53fd8dfaf3da97868555
parentcebbda0931e43097a148bbf2c4b8a1de1c77d9fa (diff)
downloadlvm2-6b25faa218fc5cd1601e5418ce1481400386ecce.tar.gz
dmeventd: Remove redundant checks.
The status of threads in _thread_registry is always DM_THREAD_RUNNING (zero). DM_EVENT_REGISTRATION_PENDING is never stored in thread->events.
-rw-r--r--daemons/dmeventd/dmeventd.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index dcde7b10f..faae5ba78 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1136,26 +1136,20 @@ static int _registered_device(struct message_data *message_data,
}
static int _want_registered_device(char *dso_name, char *device_uuid,
- struct thread_status *thread)
+ struct thread_status *thread)
{
/* If DSO names and device paths are equal. */
if (dso_name && device_uuid)
return !strcmp(dso_name, thread->dso_data->dso_name) &&
- !strcmp(device_uuid, thread->device.uuid) &&
- (thread->status == DM_THREAD_RUNNING ||
- (thread->events & DM_EVENT_REGISTRATION_PENDING));
+ !strcmp(device_uuid, thread->device.uuid);
/* If DSO names are equal. */
if (dso_name)
- return !strcmp(dso_name, thread->dso_data->dso_name) &&
- (thread->status == DM_THREAD_RUNNING ||
- (thread->events & DM_EVENT_REGISTRATION_PENDING));
+ return !strcmp(dso_name, thread->dso_data->dso_name);
/* If device paths are equal. */
if (device_uuid)
- return !strcmp(device_uuid, thread->device.uuid) &&
- (thread->status == DM_THREAD_RUNNING ||
- (thread->events & DM_EVENT_REGISTRATION_PENDING));
+ return !strcmp(device_uuid, thread->device.uuid);
return 1;
}