librbd: check event_notify to avoid extra logic

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
This commit is contained in:
Haomai Wang 2015-08-05 22:59:32 +08:00 committed by Haomai Wang
parent c7703db989
commit ca32fc5a8e

View File

@ -132,9 +132,11 @@ namespace librbd {
int n = --ref;
lock.Unlock();
if (!n) {
ictx->completed_reqs_lock.Lock();
m_xlist_item.remove_myself();
ictx->completed_reqs_lock.Unlock();
if (event_notify) {
ictx->completed_reqs_lock.Lock();
m_xlist_item.remove_myself();
ictx->completed_reqs_lock.Unlock();
}
delete this;
}
}