os/FileStore: pass old + new object name to lfn_link

For now, the only caller leaves the name the same.

Signed-off-by: Sage Weil <sage@inktank.com>
os/ObjectStore: add collection_move_rename

Add method to move an object between collections *and* change its name.

Signed-off-by: Sage Weil <sage@inktank.com>
os/FileStore: implement collection_move_rename

This is similar to a collection_add + collection_move sequence in that we
apply the same replay guards.  The difference is that we roll it up into
a single operation, change the filename, and make the omap content carry
over by calling DBObjectMap->clone (as there is no rename function or
collection awareness in the DBObjectMap).

Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: move coll_t::META_COLL definition

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: generate one-off unique temp object names

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: drop dead code from parallelexec issue_repop

This is unused and references otherwise unused variables we can remove!

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: drop unused issue_repop() arguments

These are cruft from the old parallelexec mode and can be removed.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: flag new/old temp objects in MOSDSubOp

Allow us to mark when we start and stop using a temporary object in a
sub_op.  If we start to use it, make sure the collection exists on the
replica.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: allow RepGathers with no version

If the repop has no version set, skip the updates to last_update and
last_update_{applied,ondisk} and last_complete_ondisk.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: compute full ratio from kb_avail

On btrfs, kb_used + kb_avail can be much smaller than total kb, and
what really matters to avoid filling up the disk is how much space is
available, not how much we've used.  Thus, compute the ratio we use to
determine full or nearfull from kb_avail rather than from kb_used.

Signed-off-by: Alexandre Oliva <oliva@gnu.org>
Signed-off-by: Sage Weil <sage@inktank.com>
doc: Made s3gw.fcgi paths consistent.

fixes: #6182

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Replaced code-block with inline literal to fix auto numbering.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
osd/ReplicatedPG: stage object chunks to replicas during COPY_FROM

As we get each chunk of data during the COPY_FROM operation, write it out
to a temporary object on the replicas.  When we get all the pieces, move
it into place.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: more readable output

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: factor some bits into finish_copy

This is a bit cleaner and hopefully more usable for osd-driven cache
promotion.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: add infrastructure to block io on an obc

Add an is_blocked() method for the obc, and add infrastructure to block
any operations if it returns true.  Clean up on_change(), and add a helper
to kick an obc when whatever condition leading to it being blocked is no
longer true.

For now, is_blocked() is always false...

Signed-off-by: Sage Weil <sage@inktank.com>
osd: block requests on object during COPY_FROM

Block any request on an object (read or write) during the COPY_FROM
operation.

This could potentially be broken down into read vs write operations without
much difficulty, but blocking any op indescriminately is sufficient for
now, so let's keep it simple.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: use get_version64() throughout

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: submit a racing read with every COPY_FROM

Verify that the racing read completes after the COPY_FROM does (i.e., is
blocked by it).

Signed-off-by: Sage Weil <sage@inktank.com>
osd: allow a copy_from without knowing the src_version

If we don't specify the version up front, learn the version after the first
chunk and enforce it thereafter to ensure we do not get torn content.

Signed-off-by: Sage Weil <sage@inktank.com>