Update RBD doc for OpenStack

Some updates from Icehouse, best practice configurations and
explanations.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>

Conflicts:
	doc/rbd/rbd-openstack.rst
MOSDOp: The functions are returned by const ref and parameters passed by ref

get_snapid(),get_snap_seq,get_pg,get_object_locator,get_version are returning
by reference and the corresponding setter is accepting the param by reference.
MOSDOp constructor is is accepting pg_t  by reference now.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
MOSDOpreply: The functions are returned by const ref and parameters passed by ref

get_oid,get_pg,get_replay_version,get_user_version are returning by reference and
corresponding setter is accepting param by reference.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
MOSDOpReply: Constructor initialization list is used to instantiate members

constructor initialization list is modified to initialize ops,oid,pgid with
copy constructor instead of assignment operator in the constructor body.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
OSD: pass param by ref to avoid copying overrhead

passing OpRequestRef, OSDMapRef by ref to avoid refcounting overhead
and in some cases passing structures by const ref.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
OSDMap: avoid passing pg_t by value

Passing pg_t param by cons ref for avoiding copies.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
PG: pass OpRequestRef by ref to avoid refcounting overhead

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
ceph.in: handle DYLD_LIBRARY_PATH on OS X

On OS X, the environment variable to override
to .libs is DYLD_LIBRARY_PATH instead of
LD_LIBRARY_PATH.

Signed-off-by: John Spray <john.spray@redhat.com>
common/Thread: add missing #include for pid_t

On linux this worked by side effect from
pthread.h, but POSIX header for pid_t is
sys/types.h -- this is needed on OS X.

Signed-off-by: John Spray <john.spray@redhat.com>
os/FileStore: move ZFS_SUPER_MAGIC in linux ifdef

The __SWORD_TYPE for this line is linux-specific.

Signed-off-by: John Spray <john.spray@redhat.com>
client: handle missing O_RSYNC constant

Although this is part of POSIX, it's missing on
OS X.  #define it to zero in this case so that checks
for the flag will always be false.

Signed-off-by: John Spray <john.spray@redhat.com>
common: move #include syscall into ifndef DARWIN

Signed-off-by: John Spray <john.spray@redhat.com>
os/FileStore: put SUPER usage in ifdef __linux__

This is an update to take account of 9312c5e wherein
the FS_* enum was replaced by direct use of SUPER_MAGIC
macros.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: avoid comparing MutationRef with 0

LLVM on OS X considers this == operator with an int
ambiguous: compare with an explicit MutationRef()
instead.

Signed-off-by: John Spray <john.spray@redhat.com>
Add Header cache to KeyValueStore

In the performance statistic recently, the header lookup becomes the main time
consuming for the read/write operations. Most of time it occur 50% to deal with
header lookup, decode/encode logics.

Now adding header cache using SharedLRU structure which will maintain the header
cache and caller will get the pointer to the real header. It also avoid too much
header copy operations overhead.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Remove exclusive lock on GenericObjectMap

Now most of GenericObjectMap interfaces use header as argument not the union of
coll_t and ghobject_t. So caller should be responsible for maintain the
exclusive header.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
decrement WBThrottle perfcounters in clear_object

We observed that the WBThrottle perfcounters are leaking upwards
at a rate of around 50-100 ios_dirtied per day. The counters are
currently not decremented in clear_object, so that's the likely
explanation. Decrement them like elsewhere in WBThrottle.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
common: seq_read_bench argument order changed
The argument order for seq_read_bench in src/common/obj_bencher.h has
been changed to match the argument order in obj_bencher.cc

Calls to seq_read_bench already use the correct order.
seq_read_bench also matches the order of rand_read_bench and
write_bench

Signed-off-by: Kevin Dalley <kevin@kelphead.org>
Revert "OSD: move waiting_for_pg into Session"

This reverts commit ecda2fef8ce982df3581a3b47ba74ae581d82479.

This leaves Session* refs indefinitely in the map.

This was one source of #7995.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: clear Sessions for loopback Connections on shutdown

Starting with the fast dispatch patches, we are calling the handle_connect
on loopback.  Make sure we zap them on shutdown to break the Session <->
Connection ref cycle.

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