rgw: rgwstore is not global

Instead of using a global rgwstore param, just pass it around.
We now do it almost all around, except for in rgw_admin, where
we can still have the global one.
This is part of a cleanup that will allow setting flexible
pool names.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: RGWRados holds domain root info

Continuing cleanup work.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: pool names are not global

Move all hard coded pool names outside of the global
namespace.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: remove static store object

We used to instantiate a single RGWRados object.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: cleanup create_bucket

Pool creation is now being done through an excplicit
method, get rid of the unused user param when creating
a pool, and remove auid.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
objclass: add remove operation

Added a missing remove object operation

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
cls_lock: fix some spacing

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_lock_client: clean up reference parameters

These should all be const. The remaining reference parameters
will be converted to pointers in another commit.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_lock_client: change modified reference parameters to pointers

This makes it clear which parameters are modified,
as our style guide states.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_lock_client: fix indentation

Add indentation settings to header, and reindent.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_lock_client: return error when decoding fails

Library code shouldn't be using cerr either.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_lock_types: add missing include

msg_types defines entity-related types used here.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_lock_client: add ObjectOperation-based get_lock_info

This will be used by librbd to grab lock info along with
the rest of its header information in a single request.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_refcount: a new class for objects refcounting

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
librbd: use generic cls_lock instead of cls_rbd's locking

Update the librbd locking api to make more sense:
 * Add an optional tag to shared locking
 * only make shared vs exclusive different functions in the user-visible api
 * return a list of structs instead of a set of pairs
 * fix incorrect range checking in the C api
 * rename locks to lockers to be consistent with the generic locking class
 * rename other_locker parameter to client, to match the list_lockers usage

Fixes: #2952
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
qa: update rbd tests and runner

* no longer need to wait for watch timeout since #2948 was fixed
* use --format 2 instead of --new-format
* add test_cls_rbd to run-rbd-tests script

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: add locking commands

The locker (entity_name_t) will be different each time the rbd
command line tool is run, so 'lock remove' is always breaking a lock.

Fixes: #2556
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
cls_rbd: remove locking methods

These are unnecessary now that librbd is using the generic cls_lock.

Fixes: #2951
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: bump version

This marks the availability of the cloning and locking functions.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rgw: fix rgw_dir_suggest_changes() to set header_changed

Apparently we weren't setting header_changed to true in the
case where we handled the CEPH_RGW_UPDATE case and cur_disk.exists
was false. In practice what this created is that in case where
object was created but the index complete call failed (or timed
out), calling rgw_dir_suggest_changes() fixed the entry, however,
we didn't account the new entry. This would lead to negative
stats on the bucket index.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>