client: add ceph_open_layout interface

Adds an interface identical to ceph_open() that takes additional
parameters specifying a file layout to use on new files.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
java: add ceph_open_layout interface

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
rgw: POST requests not default to init multipart upload

Fixes: #3516
We don't default to init multipart upload request when
getting S3 POST. This way when the request is not really
init multipart upload we'd end up sending a 405 response
instead of 500. Also, it's cleaner this way.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Search for srcdir/.git in check_version

Support srcdir != . looking for .git in srcdir when computing the ceph
release and git tag.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
logrotate on systems without invoke-rc.d

The which command doesn't output anything to stdout when it can't find
the given program name, and then [ -x ] passes.  Use the exit status
of which to tell whether the command exists, before testing whether
it's executable, to fix it.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
rgw: usage REST api handles cateogories

Fixes: #3528
The usage REST api was missing the categories filter.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: document ops logging setup

Fixes: #3530

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
osdc/ObjectCacher: *do* pin object during write

This hopefully resolves #3431.

We originally did this in 46897fd4ffc2fe2fc2cc0c39b5d4c510df1e6c25, and
then reverted in caed0e917f8044d389d01de5ee5ecbf0d16ff349.

The current conundrum:
 - commit_set() will issue a write and queue a waiter on a tid
 - discard will discard all BufferHeads and unpin the object
 - trim will try to close and fail assert(ob->can_close())

But:
 - we can't wake the waiter on discard because we don't know what range(s)
   it is waiting for; discard needn't be the whole object.

So: pin the object so it doesn't get trimmed, and unpin when we write.

Adjust can_close() so that it is based on the lru pin status, and assert
that pinned implies the previous conditions are all true.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Lang <sam.lang@inktank.com>
osdc/ObjectCacher: remove unused waitfor_{rd,wr}

Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'next'
osdc/ObjectCacher: touch Objects in lru

Touch the object when we touch one of it's bh's, and when we touch it
during readx (possibly because it is negative).

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: allow parsing image@snap even if --pool given

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd: --size fixes

* require --size/-s for both create *and* resize
* explicitly permit create with size 0.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd: change destpool assumptions.

Don't default destpool to srcpool; it's surprising, and
not useful/helpful enough to violate the convention that
"default pool is rbd"

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd: fix import pool assumptions

import allows specifying one image, implicitly or explicitly the
"source" image, even though it's really the destination.  Fix up
the reassignment of 'source' to 'dest', and check for and complain
about specifying two different pools or images for import.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd: tests for copy with explicit/implicit pool names

Validate change to not assume dest pool == src pool

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd workunit: Add tests for cross-pool rename

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd workunit: Make "remove_images" silent

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd workunit: Add tests for clones across pools

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge branch 'wip-rbd-cmdparse'

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>