string name;
int r = read_key(hctx, dir_key_for_id(id), &name);
if (r < 0) {
- CLS_ERR("error reading name for id '%s': %s", id.c_str(), cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading name for id '%s': %s", id.c_str(),
+ cpp_strerror(r).c_str());
+ }
return r;
}
encode(name, *out);
int r = cls_cxx_map_get_vals(hctx, last_read, RBD_DIR_NAME_KEY_PREFIX,
max_read, &vals, &more);
if (r < 0) {
- CLS_ERR("error reading directory by name: %s", cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading directory by name: %s", cpp_strerror(r).c_str());
+ }
return r;
}
int r = cls_cxx_map_get_vals(hctx, last_read, RBD_METADATA_KEY_PREFIX,
max_read, &raw_data, &more);
if (r < 0) {
- CLS_ERR("failed to read the vals off of disk: %s", cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("failed to read the vals off of disk: %s",
+ cpp_strerror(r).c_str());
+ }
return r;
}
int r = cls_cxx_map_get_vals(hctx, last_read, PEER_KEY_PREFIX.c_str(),
max_read, &vals, &more);
if (r < 0) {
- CLS_ERR("error reading peers: %s", cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading peers: %s", cpp_strerror(r).c_str());
+ }
return r;
}
r = cls_cxx_map_get_vals(hctx, last_read, IMAGE_KEY_PREFIX, max_read, &vals,
&more);
if (r < 0) {
- CLS_ERR("error reading mirror image directory by name: %s",
- cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading mirror image directory by name: %s",
+ cpp_strerror(r).c_str());
+ }
return r;
}
return 0;
}
-int image_status_get_summary(cls_method_context_t hctx,
- std::map<cls::rbd::MirrorImageStatusState, int> *states) {
+int image_status_get_summary(
+ cls_method_context_t hctx,
+ std::map<cls::rbd::MirrorImageStatusState, int> *states) {
std::set<entity_inst_t> watchers;
int r = list_watchers(hctx, &watchers);
if (r < 0) {
r = cls_cxx_map_get_vals(hctx, last_read, IMAGE_KEY_PREFIX,
max_read, &vals, &more);
if (r < 0) {
- CLS_ERR("error reading mirrored images: %s", cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading mirrored images: %s", cpp_strerror(r).c_str());
+ }
return r;
}
r = cls_cxx_map_get_vals(hctx, last_read, STATUS_GLOBAL_KEY_PREFIX,
max_read, &vals, &more);
if (r < 0) {
- CLS_ERR("error reading mirrored images: %s", cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading mirrored images: %s", cpp_strerror(r).c_str());
+ }
return r;
}
r = cls_cxx_map_get_vals(hctx, last_read, IMAGE_KEY_PREFIX, max_read, &vals,
&more);
if (r < 0) {
- CLS_ERR("error reading mirror image directory by name: %s",
- cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading mirror image directory by name: %s",
+ cpp_strerror(r).c_str());
+ }
return r;
}
int r = cls_cxx_map_get_vals(hctx, last_read, mirror::IMAGE_KEY_PREFIX,
max_read, &vals, &more);
if (r < 0) {
- CLS_ERR("error reading mirror image directory by name: %s",
- cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading mirror image directory by name: %s",
+ cpp_strerror(r).c_str());
+ }
return r;
}
int r = cls_cxx_map_get_vals(hctx, last_read, RBD_DIR_NAME_KEY_PREFIX,
max_read, &vals, &more);
if (r < 0) {
- CLS_ERR("error reading directory by name: %s", cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("error reading directory by name: %s", cpp_strerror(r).c_str());
+ }
return r;
}
int r = cls_cxx_map_get_vals(hctx, last_read, trash::IMAGE_KEY_PREFIX,
max_read, &raw_data, &more);
if (r < 0) {
- CLS_ERR("failed to read the vals off of disk: %s",
- cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("failed to read the vals off of disk: %s",
+ cpp_strerror(r).c_str());
+ }
return r;
}
if (raw_data.empty()) {
int r = cls_cxx_map_get_vals(hctx, last_read, nspace::NAME_KEY_PREFIX,
max_read, &raw_data, &more);
if (r < 0) {
- CLS_ERR("failed to read the vals off of disk: %s",
- cpp_strerror(r).c_str());
+ if (r != -ENOENT) {
+ CLS_ERR("failed to read the vals off of disk: %s",
+ cpp_strerror(r).c_str());
+ }
return r;
}