: default_perms(),
mounted(false),
inited(false),
- client(NULL),
- monclient(NULL),
- messenger(NULL),
+ client(nullptr),
+ monclient(nullptr),
+ messenger(nullptr),
cct(cct_)
{
- if (cct_ != nullptr) {
+ if (cct_) {
cct->get();
}
}
shutdown();
if (cct) {
cct->put();
- cct = NULL;
+ cct = nullptr;
}
}
catch (const std::exception& e) {
messenger->shutdown();
messenger->wait();
delete messenger;
- messenger = NULL;
+ messenger = nullptr;
}
if (monclient) {
delete monclient;
- monclient = NULL;
+ monclient = nullptr;
}
if (client) {
delete client;
- client = NULL;
+ client = nullptr;
}
}
int conf_read_file(const char *path_list)
{
- int ret = cct->_conf->parse_config_files(path_list, NULL, 0);
+ int ret = cct->_conf->parse_config_files(path_list, nullptr, 0);
if (ret)
return ret;
- cct->_conf->apply_changes(NULL);
+ cct->_conf->apply_changes(nullptr);
cct->_conf->complain_about_parse_errors(cct);
return 0;
}
ret = cct->_conf->parse_argv(args);
if (ret)
return ret;
- cct->_conf->apply_changes(NULL);
+ cct->_conf->apply_changes(nullptr);
return 0;
}
int ret = conf->parse_argv(args);
if (ret)
return ret;
- conf->apply_changes(NULL);
+ conf->apply_changes(nullptr);
return 0;
}
int ret = cct->_conf->set_val(option, value);
if (ret)
return ret;
- cct->_conf->apply_changes(NULL);
+ cct->_conf->apply_changes(nullptr);
return 0;
}
*outbuf = (char *)malloc(outbl.length());
memcpy(*outbuf, outbl.c_str(), outbl.length());
} else {
- *outbuf = NULL;
+ *outbuf = nullptr;
}
}
if (outbuflen)
*outbuf = (char *)malloc(outbl.length());
memcpy(*outbuf, outbl.c_str(), outbl.length());
} else {
- *outbuf = NULL;
+ *outbuf = nullptr;
}
}
if (outbuflen)
CephContext *cct = common_preinit(iparams, CODE_ENVIRONMENT_LIBRARY, 0);
cct->_conf->parse_env(); // environment variables coverride
- cct->_conf->apply_changes(NULL);
+ cct->_conf->apply_changes(nullptr);
int ret = ceph_create_with_context(cmount, cct);
cct->put();
+ cct = nullptr;
return ret;
}
if (cmount->is_mounted())
return -EISCONN;
delete cmount;
+ cmount = nullptr;
return 0;
}
{
cmount->shutdown();
delete cmount;
+ cmount = nullptr;
}
extern "C" int ceph_conf_read_file(struct ceph_mount_info *cmount, const char *path)
extern "C" int ceph_conf_get(struct ceph_mount_info *cmount, const char *option,
char *buf, size_t len)
{
- if (buf == NULL) {
+ if (!buf) {
return -EINVAL;
}
return cmount->conf_get(option, buf, len);
if (!cmount->is_mounted()) {
/* Client::readdir also sets errno to signal errors. */
errno = ENOTCONN;
- return NULL;
+ return nullptr;
}
return cmount->get_client()->readdir(reinterpret_cast<dir_result_t*>(dirp));
}
return r;
}
- assert(inode != NULL);
- assert(*inode != NULL);
+ assert(inode);
+ assert(*inode);
// Request the parent inode, so that we can look up the name
Inode *parent;
}
// FIXME: I don't think this works; lookup_parent() returns 0 if the parent
// is already in cache
- assert(parent != NULL);
+ assert(parent);
// Finally, get the name (dentry) of the requested inode
r = (cmount->get_client())->lookup_name(*inode, parent, cmount->default_perms);