bufferlist bl;
map<string, bufferlist> keys;
- rc = cls_cxx_map_read_keys(hctx, op.start_obj, op.filter_prefix, op.num_entries + 1, &keys);
+ rc = cls_cxx_map_get_vals(hctx, op.start_obj, op.filter_prefix, op.num_entries + 1, &keys);
if (rc < 0)
return rc;
// get on-disk state
bufferlist cur_value;
- int rc = cls_cxx_map_read_key(hctx, op.name, &cur_value);
+ int rc = cls_cxx_map_get_val(hctx, op.name, &cur_value);
if (rc < 0 && rc != -ENOENT)
return rc;
// write out new key to disk
bufferlist info_bl;
::encode(entry, info_bl);
- cls_cxx_map_write_key(hctx, op.name, &info_bl);
+ cls_cxx_map_set_val(hctx, op.name, &info_bl);
return rc;
}
bufferlist current_entry;
struct rgw_bucket_dir_entry entry;
bool ondisk = true;
- rc = cls_cxx_map_read_key(hctx, op.name, ¤t_entry);
+ rc = cls_cxx_map_get_val(hctx, op.name, ¤t_entry);
if (rc < 0) {
if (rc != -ENOENT) {
return rc;
if (op.tag.size()) {
bufferlist new_key_bl;
::encode(entry, new_key_bl);
- return cls_cxx_map_write_key(hctx, op.name, &new_key_bl);
+ return cls_cxx_map_set_val(hctx, op.name, &new_key_bl);
} else {
return 0;
}
entry.exists = false;
bufferlist new_key_bl;
::encode(entry, new_key_bl);
- int ret = cls_cxx_map_write_key(hctx, op.name, &new_key_bl);
+ int ret = cls_cxx_map_set_val(hctx, op.name, &new_key_bl);
if (ret < 0)
return ret;
}
stats.total_size_rounded += get_rounded_size(meta.size);
bufferlist new_key_bl;
::encode(entry, new_key_bl);
- int ret = cls_cxx_map_write_key(hctx, op.name, &new_key_bl);
+ int ret = cls_cxx_map_set_val(hctx, op.name, &new_key_bl);
if (ret < 0)
return ret;
}
}
bufferlist cur_disk_bl;
- int ret = cls_cxx_map_read_key(hctx, cur_change.name, &cur_disk_bl);
+ int ret = cls_cxx_map_get_val(hctx, cur_change.name, &cur_disk_bl);
if (ret < 0 && ret != -ENOENT)
return -EINVAL;
stats.total_size_rounded += get_rounded_size(cur_change.meta.size);
bufferlist cur_state_bl;
::encode(cur_change, cur_state_bl);
- ret = cls_cxx_map_write_key(hctx, cur_change.name, &cur_state_bl);
+ ret = cls_cxx_map_set_val(hctx, cur_change.name, &cur_state_bl);
if (ret < 0)
return ret;
break;
return (*pctx)->pg->do_osd_ops(*pctx, ops);
}
-int cls_cxx_map_read_all_keys(cls_method_context_t hctx, map<string, bufferlist>* vals)
+int cls_cxx_map_get_all_vals(cls_method_context_t hctx, map<string, bufferlist>* vals)
{
ReplicatedPG::OpContext **pctx = (ReplicatedPG::OpContext **)hctx;
vector<OSDOp> ops(1);
return vals->size();
}
-int cls_cxx_map_read_keys(cls_method_context_t hctx, const string &start_obj,
- const string &filter_prefix, uint64_t max,
- map<string, bufferlist> *vals)
+int cls_cxx_map_get_vals(cls_method_context_t hctx, const string &start_obj,
+ const string &filter_prefix, uint64_t max_to_get,
+ map<string, bufferlist> *vals)
{
ReplicatedPG::OpContext **pctx = (ReplicatedPG::OpContext **)hctx;
vector<OSDOp> ops(1);
bufferlist inbl;
::encode(start_obj, op.indata);
- ::encode(max, op.indata);
+ ::encode(max_to_get, op.indata);
::encode(filter_prefix, op.indata);
op.op.op = CEPH_OSD_OP_OMAPGETVALS;
return 0;
}
-int cls_cxx_map_read_key(cls_method_context_t hctx, const string &key, bufferlist *outbl)
+
+int cls_cxx_map_get_val(cls_method_context_t hctx, const string &key,
+ bufferlist *outbl)
{
ReplicatedPG::OpContext **pctx = (ReplicatedPG::OpContext **)hctx;
vector<OSDOp> ops(1);
return 0;
}
-int cls_cxx_map_write_key(cls_method_context_t hctx, const string &key, bufferlist *inbl)
+int cls_cxx_map_set_val(cls_method_context_t hctx, const string &key,
+ bufferlist *inbl)
{
ReplicatedPG::OpContext **pctx = (ReplicatedPG::OpContext **)hctx;
vector<OSDOp> ops(1);
extern int cls_cxx_replace(cls_method_context_t hctx, int ofs, int len, bufferlist *bl);
extern int cls_cxx_snap_revert(cls_method_context_t hctx, snapid_t snapid);
extern int cls_cxx_map_clear(cls_method_context_t hctx);
-extern int cls_cxx_map_read_all_keys(cls_method_context_t hctx, std::map<string, bufferlist> *keys);
-extern int cls_cxx_map_read_keys(cls_method_context_t hctx, const string &start_after, const string &filter_prefix,
- uint64_t max, std::map<string, bufferlist> *keys);
+extern int cls_cxx_map_get_all_vals(cls_method_context_t hctx,
+ std::map<string, bufferlist> *vals);
+extern int cls_cxx_map_get_vals(cls_method_context_t hctx,
+ const string &start_after,
+ const string &filter_prefix,
+ uint64_t max_to_get,
+ std::map<string, bufferlist> *vals);
extern int cls_cxx_map_read_header(cls_method_context_t hctx, bufferlist *outbl);
-extern int cls_cxx_map_read_key(cls_method_context_t hctx, const string &key, bufferlist *outbl);
-extern int cls_cxx_map_write_key(cls_method_context_t hctx, const string &key, bufferlist *inbl);
+extern int cls_cxx_map_get_val(cls_method_context_t hctx,
+ const string &key, bufferlist *outbl);
+extern int cls_cxx_map_set_val(cls_method_context_t hctx,
+ const string &key, bufferlist *inbl);
extern int cls_cxx_map_write_header(cls_method_context_t hctx, bufferlist *inbl);
extern int cls_cxx_map_remove_key(cls_method_context_t hctx, const string &key);
extern int cls_cxx_map_update(cls_method_context_t hctx, bufferlist *inbl);