rbd: allow striping to be specified on image creation

Signed-off-by: Sage Weil <sage@inktank.com>
cls_rbd: fix snap key filtering

Ignore any omap keys that don't begin with "snap_".  We got away with this
previously because it was (lexiographically) the last key for the object.

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: expose image striping properties

Fix C and C++ APIs.

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: show striping parameters with 'info' command

Signed-off-by: Sage Weil <sage@inktank.com>
filer: generalize file_to_extents to take a format string

Allow any format string to be used, so long as it takes a long long
unsigned.

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: populate struct ceph_file_layout for image

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

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: document stripe unit options on man page

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: update python bindings for striped image creation

Signed-off-by: Sage Weil <sage@inktank.com>
filer: include (numeric) objectno in ObjectExtent

This lets us map backwards, if we need to.  Arguably the oid and oloc
don't belong here at all.  That can come later.

Signed-off-by: Sage Weil <sage@inktank.com>
filer: use vector<pair<>> instead of map<> for buffer extent map

This is less inefficient.  :)

Signed-off-by: Sage Weil <sage@inktank.com>
filer: add helper to map from object extent to file extents

Given an extent in an object and a layout, map it back to extent(s) in the
original file.

Signed-off-by: Sage Weil <sage@inktank.com>
filer: add optional buffer offset

It may be that some range is being mapped that is intended for some offset
within the result buffer.

Signed-off-by: Sage Weil <sage@inktank.com>
buffer: add claim_prepend()

Steal another bufferlist's content and prepend it to our own.

Signed-off-by: Sage Weil <sage@inktank.com>
filer: helper to assemble striped read results into a single result

This is intended to replace the Objecter::_sg_read_finish() monstrosity,
and be reused by the librbd striping code.

Signed-off-by: Sage Weil <sage@inktank.com>
objecter: use StripedReadResult for scatter/gather read

This vastly simplifies the code, and uses the more generic helper class.

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: remove callback from handle_sparse_read

We always used simple_read_cb, so put it inline.

Signed-off-by: Sage Weil <sage@inktank.com>
filer: make tail zeroing in stripe result assembly optional

Objecter doesn't want it, librbd will.

Signed-off-by: Sage Weil <sage@inktank.com>
filer: add sparse result into a striped read result

Add a helper to assimilate a sparse read result into the destriper
helper class.

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

This replaces most of the existing striping code with use of the Filer
striping helper methods and a more general ceph_file_layout that can
handle more sophisticated striping patterns that the previous uniform
object approach.

This patch is not fully complete; there are a few additional patches that
follow that clean up some of the support functions.  However, most of the
IO path is covered here.

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