]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: use unlock_guard for unlock osd temporarily
authorKefu Chai <kchai@redhat.com>
Sun, 30 Dec 2018 13:46:55 +0000 (21:46 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 30 Dec 2018 15:18:09 +0000 (23:18 +0800)
commit5c628a1cc9f703351ad3bd708e908df7c9a411bb
tree19fec6a4ca0a4a808542f1dfaf606641c2fc12fa
parent55959be90ad4eba01baa9672cf4522b85c4e02a8
osd: use unlock_guard for unlock osd temporarily

when OSD::do_command() gets called, osd_lock is acquired. but when
serving some of these commands, we need to call methods which also
acquire the osd_lock by themselves. for instance,
OSD::handle_conf_change() gets called by cct->_conf.apply_changes().
to allow them to do so, we unlock osd_lock before calling those methods,
and re-lock it after done with them.

unlock_guard is introduced to unlock and re-lock the lock in a RAII style.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/OSD.cc