From b951b65dfc17c2272c39889af06ff187d4642a2f Mon Sep 17 00:00:00 2001 From: Shinobu Kinjo Date: Sun, 19 Nov 2017 06:23:11 +0900 Subject: [PATCH] rbd: drop unnecessary using declaration, etc Signed-off-by: Shinobu Kinjo --- src/krbd.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/krbd.cc b/src/krbd.cc index 523c3db1f5f6d..45f41e2d96b61 100644 --- a/src/krbd.cc +++ b/src/krbd.cc @@ -40,7 +40,6 @@ #include #include -using namespace std; const static int POLL_TIMEOUT=120000; @@ -133,10 +132,13 @@ static int build_map_buf(CephContext *cct, const char *pool, const char *image, oss << " name=" << cct->_conf->name.get_id(); KeyRing keyring; - if (cct->_conf->auth_client_required != "none") { + auto auth_client_required = + cct->_conf->get_val("auth_client_required"); + if (auth_client_required != "none") { r = keyring.from_ceph_context(cct); - if (r == -ENOENT && !(cct->_conf->keyfile.length() || - cct->_conf->key.length())) + auto keyfile = cct->_conf->get_val("keyfile"); + auto key = cct->_conf->get_val("key"); + if (r == -ENOENT && keyfile.empty() && key.empty()) r = 0; if (r < 0) { cerr << "rbd: failed to get secret" << std::endl; @@ -180,7 +182,7 @@ static int wait_for_udev_add(struct udev_monitor *mon, const char *pool, const char *image, const char *snap, string *pname) { - struct udev_device *bus_dev = NULL; + struct udev_device *bus_dev = nullptr; /* * Catch /sys/devices/rbd// and wait for the corresponding @@ -257,7 +259,7 @@ static int do_map(struct udev *udev, const char *pool, const char *image, if (!mon) return -ENOMEM; - r = udev_monitor_filter_add_match_subsystem_devtype(mon, "rbd", NULL); + r = udev_monitor_filter_add_match_subsystem_devtype(mon, "rbd", nullptr); if (r < 0) goto out_mon; -- 2.39.5