Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: resolve compiler warnings #13236

Merged
merged 8 commits into from Feb 8, 2017
@@ -208,7 +208,10 @@ int ceph_create(struct ceph_mount_info **cmount, const char * const id);
int ceph_create_with_context(struct ceph_mount_info **cmount, struct CephContext *conf);


#ifndef VOIDPTR_RADOS_T
#define VOIDPTR_RADOS_T
typedef void *rados_t;
#endif // VOIDPTR_RADOS_T

/**
* Create a mount handle from a rados_t, for using libcephfs in the
@@ -166,7 +166,10 @@ enum {
* -- or to the same cluster with different users -- requires
* different cluster handles.
*/
#ifndef VOIDPTR_RADOS_T
#define VOIDPTR_RADOS_T
typedef void *rados_t;
#endif //VOIDPTR_RADOS_T

/**
* @typedef rados_config_t
@@ -177,7 +177,7 @@ int KvFlatBtreeAsync::next(const index_data &idata, index_data * out_data)
int err = 0;
librados::ObjectReadOperation oro;
std::map<std::string, bufferlist> kvs;
oro.omap_get_vals(idata.kdata.encoded(),1,&kvs,&err);
oro.omap_get_vals2(idata.kdata.encoded(),1,&kvs, nullptr, &err);
err = io_ctx.operate(index_name, &oro, NULL);
if (err < 0){
if (verbose) cout << "\t\t\t" << client_name
@@ -271,9 +271,9 @@ int KvFlatBtreeAsync::read_index(const string &key, index_data * idata,
std::map<std::string, bufferlist> kvmap;
std::map<std::string, bufferlist> dupmap;
oro.omap_get_vals_by_keys(key_set, &dupmap, &err);
oro.omap_get_vals(key_data(key).encoded(),
oro.omap_get_vals2(key_data(key).encoded(),
(cache_size / cache_refresh >= 2? cache_size / cache_refresh: 2),
&kvmap,&err);
&kvmap, nullptr, &err);
err = io_ctx.operate(index_name, &oro, NULL);
utime_t mytime = ceph_clock_now();
if (err < 0){
@@ -660,7 +660,7 @@ int KvFlatBtreeAsync::read_object(const string &obj, object_data * odata) {
int err;
bufferlist unw_bl;
odata->name = obj;
get_obj.omap_get_vals("", LONG_MAX, &odata->omap, &err);
get_obj.omap_get_vals2("", LONG_MAX, &odata->omap, nullptr, &err);
get_obj.getxattr("unwritable", &unw_bl, &err);
io_ctx.aio_operate(obj, obj_aioc, &get_obj, NULL);
obj_aioc->wait_for_safe();
@@ -1943,7 +1943,7 @@ int KvFlatBtreeAsync::remove_all() {
librados::ObjectReadOperation oro;
librados::AioCompletion * oro_aioc = rados.aio_create_completion();
std::map<std::string, bufferlist> index_set;
oro.omap_get_vals("",LONG_MAX,&index_set,&err);
oro.omap_get_vals2("",LONG_MAX,&index_set, nullptr, &err);
err = io_ctx.aio_operate(index_name, oro_aioc, &oro, NULL);
if (err < 0){
if (err == -ENOENT) {
@@ -1996,7 +1996,7 @@ int KvFlatBtreeAsync::get_all_keys(std::set<std::string> *keys) {
int err = 0;
librados::ObjectReadOperation oro;
std::map<std::string,bufferlist> index_set;
oro.omap_get_vals("",LONG_MAX,&index_set,&err);
oro.omap_get_vals2("",LONG_MAX,&index_set, nullptr, &err);
io_ctx.operate(index_name, &oro, NULL);
if (err < 0){
if (verbose) cout << "getting keys failed with error " << err << std::endl;
@@ -2006,7 +2006,7 @@ int KvFlatBtreeAsync::get_all_keys(std::set<std::string> *keys) {
it != index_set.end(); ++it){
librados::ObjectReadOperation sub;
std::set<std::string> ret;
sub.omap_get_keys("",LONG_MAX,&ret,&err);
sub.omap_get_keys2("",LONG_MAX,&ret, nullptr, &err);
index_data idata;
bufferlist::iterator b = it->second.begin();
idata.decode(b);
@@ -2023,7 +2023,7 @@ int KvFlatBtreeAsync::get_all_keys_and_values(
int err = 0;
librados::ObjectReadOperation first_read;
std::set<std::string> index_set;
first_read.omap_get_keys("",LONG_MAX,&index_set,&err);
first_read.omap_get_keys2("",LONG_MAX,&index_set, nullptr, &err);
io_ctx.operate(index_name, &first_read, NULL);
if (err < 0){
if (verbose) cout << "getting keys failed with error " << err << std::endl;
@@ -2033,7 +2033,7 @@ int KvFlatBtreeAsync::get_all_keys_and_values(
it != index_set.end(); ++it){
librados::ObjectReadOperation sub;
map<std::string, bufferlist> ret;
sub.omap_get_vals("",LONG_MAX,&ret,&err);
sub.omap_get_vals2("",LONG_MAX,&ret, nullptr, &err);
io_ctx.operate(*it, &sub, NULL);
kv_map->insert(ret.begin(), ret.end());
}
@@ -2047,7 +2047,7 @@ bool KvFlatBtreeAsync::is_consistent() {
std::map<std::string,bufferlist> index;
map<std::string, std::set<std::string> > sub_objs;
librados::ObjectReadOperation oro;
oro.omap_get_vals("",LONG_MAX,&index,&err);
oro.omap_get_vals2("",LONG_MAX,&index, nullptr, &err);
io_ctx.operate(index_name, &oro, NULL);
if (err < 0){
//probably because the index doesn't exist - this might be ok.
@@ -2131,7 +2131,7 @@ bool KvFlatBtreeAsync::is_consistent() {
it != parsed_index.end();
++it) {
librados::ObjectReadOperation read;
read.omap_get_keys("", LONG_MAX, &sub_objs[it->second], &err);
read.omap_get_keys2("", LONG_MAX, &sub_objs[it->second], nullptr, &err);
err = io_ctx.operate(it->second, &read, NULL);
int size_int = (int)sub_objs[it->second].size();

@@ -2184,7 +2184,7 @@ string KvFlatBtreeAsync::str() {
std::map<std::string,bufferlist> index;
librados::ObjectReadOperation oro;
librados::AioCompletion * top_aioc = rados.aio_create_completion();
oro.omap_get_vals("",LONG_MAX,&index,&err);
oro.omap_get_vals2("",LONG_MAX,&index, nullptr, &err);
io_ctx.aio_operate(index_name, top_aioc, &oro, NULL);
top_aioc->wait_for_safe();
err = top_aioc->get_return_value();
@@ -2240,7 +2240,7 @@ string KvFlatBtreeAsync::str() {
++it) {
librados::ObjectReadOperation oro;
librados::AioCompletion *aioc = rados.aio_create_completion();
oro.omap_get_vals("", LONG_MAX, &all_maps[indexer], &err);
oro.omap_get_vals2("", LONG_MAX, &all_maps[indexer], nullptr, &err);
oro.getxattr("unwritable", &all_unwrit[indexer], &err);
io_ctx.aio_operate(*it, aioc, &oro, NULL);
aioc->wait_for_safe();
@@ -318,7 +318,6 @@ class BlueStore : public ObjectStore,
};

struct SharedBlobSet;
struct Collection;

/// in-memory shared blob state (incl cached buffers)
struct SharedBlob {
@@ -285,7 +285,7 @@ int RGWRadosGetOmapKeysCR::send_request() {
set_status() << "send request";

librados::ObjectReadOperation op;
op.omap_get_vals(marker, max_entries, entries, &rval);
op.omap_get_vals2(marker, max_entries, entries, nullptr, &rval);

cn = stack->create_completion_notifier();
return ioctx.aio_operate(oid, cn->completion(), &op, NULL);
@@ -25,12 +25,7 @@
#define dout_subsys ceph_subsys_rgw

RGWFormatter_Plain::RGWFormatter_Plain(const bool ukv)
: buf(NULL),
len(0),
max_len(0),
wrote_something(false),
min_stack_level(0),
use_kv(ukv)
: use_kv(ukv)
{
}

@@ -50,14 +50,14 @@ class RGWFormatter_Plain : public Formatter {
void write_data(const char *fmt, ...);
void dump_value_int(const char *name, const char *fmt, ...);

char *buf;
int len;
int max_len;
char *buf = nullptr;
int len = 0;
int max_len = 0;

std::list<struct plain_stack_entry> stack;
size_t min_stack_level;
size_t min_stack_level = 0;
bool use_kv;
bool wrote_something;
bool wrote_something = 0;
};


@@ -1050,7 +1050,7 @@ TEST_F(TestClsRbd, snapshots_timestamps)
ASSERT_EQ(0, get_snapcontext(&ioctx, oid, &snapc));
ASSERT_EQ(1u, snapc.snaps.size());
ASSERT_EQ(0, snapshot_timestamp_list(&ioctx, oid, snapc.snaps, &snap_timestamps));
ASSERT_LT(0, snap_timestamps[0].tv.tv_sec);
ASSERT_LT(0U, snap_timestamps[0].tv.tv_sec);
ioctx.close();
}

@@ -77,7 +77,7 @@ std::unique_ptr<CrushWrapper> build_indep_map(CephContext *cct, int num_rack,
delete f;
}

return std::move(c);
return c;
}

int get_num_dups(const vector<int>& v)
@@ -43,6 +43,8 @@ struct ManagedLock<MockExclusiveLockImageCtx> {
: m_lock("ManagedLock::m_lock") {
}

virtual ~ManagedLock() = default;

mutable Mutex m_lock;

virtual void shutdown_handler(int r, Context *) = 0;
@@ -56,6 +56,8 @@ struct ManagedLock<MockTestImageCtx> {
: m_lock("ManagedLock::m_lock") {
}

virtual ~ManagedLock() = default;

mutable Mutex m_lock;

bool is_lock_owner() const {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.