mirror of
https://github.com/ceph/ceph
synced 2025-02-21 01:47:25 +00:00
Merge pull request #7232 from lzhng2000/master
cls/cls_rbd: pass string by reference Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
73769f610b
@ -2983,7 +2983,7 @@ int read_peers(cls_method_context_t hctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_peer(cls_method_context_t hctx, const std::string uuid,
|
||||
int read_peer(cls_method_context_t hctx, const std::string &uuid,
|
||||
cls::rbd::MirrorPeer *peer) {
|
||||
bufferlist bl;
|
||||
int r = cls_cxx_map_get_val(hctx, peer_key(uuid), &bl);
|
||||
@ -3003,7 +3003,7 @@ int read_peer(cls_method_context_t hctx, const std::string uuid,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_peer(cls_method_context_t hctx, const std::string uuid,
|
||||
int write_peer(cls_method_context_t hctx, const std::string &uuid,
|
||||
const cls::rbd::MirrorPeer &peer) {
|
||||
bufferlist bl;
|
||||
::encode(peer, bl);
|
||||
|
@ -104,7 +104,7 @@ int rados_pool_set(
|
||||
rados_t *cluster,
|
||||
const std::string &pool_name,
|
||||
const std::string &var,
|
||||
const std::string val)
|
||||
const std::string &val)
|
||||
{
|
||||
JSONFormatter cmd_f;
|
||||
cmd_f.open_object_section("command");
|
||||
|
@ -591,7 +591,7 @@ int init_and_open_image(const std::string &pool_name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snap_set(librbd::Image &image, const std::string snap_name) {
|
||||
int snap_set(librbd::Image &image, const std::string &snap_name) {
|
||||
int r = image.snap_set(snap_name.c_str());
|
||||
if (r < 0) {
|
||||
std::cerr << "error setting snapshot context: " << cpp_strerror(r)
|
||||
|
@ -96,7 +96,7 @@ int init_and_open_image(const std::string &pool_name,
|
||||
librados::Rados *rados, librados::IoCtx *io_ctx,
|
||||
librbd::Image *image);
|
||||
|
||||
int snap_set(librbd::Image &image, const std::string snap_name);
|
||||
int snap_set(librbd::Image &image, const std::string &snap_name);
|
||||
|
||||
std::string image_id(librbd::Image& image);
|
||||
|
||||
|
@ -62,12 +62,12 @@ static std::string map_option_int_cb(const char *value_char)
|
||||
return stringify(d);
|
||||
}
|
||||
|
||||
static void put_map_option(const std::string key, std::string val)
|
||||
static void put_map_option(const std::string &key, std::string val)
|
||||
{
|
||||
map_options[key] = val;
|
||||
}
|
||||
|
||||
static int put_map_option_value(const std::string opt, const char *value_char,
|
||||
static int put_map_option_value(const std::string &opt, const char *value_char,
|
||||
std::string (*parse_cb)(const char *))
|
||||
{
|
||||
if (!value_char || *value_char == '\0') {
|
||||
|
Loading…
Reference in New Issue
Block a user