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>
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>
Add random cache and replace SharedLRU in KeyValueStore

SharedLRU plays pool performance in KeyValueStore with large header cache size,
so a performance optimized RandomCache could improve it.

RandomCache will record the lookup frequency of key. When evictint element,
it will randomly compare several elements's frequency and evict the least
one.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Use submit_transaction_sync to make change durable

submit_transaction will use asynchronous write operation, there is no journal
for keyvaluestore so we need to make it sync

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Fix the PG listing issue which could miss objects for EC pool (where there is object shard and generation).
Backport: firefly
Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
doc: Added keyring location note to resolve pull abandoned pull request #1946.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
rgw: fix RGWObjManifestRule decoder

Only decode the new field if it is a new struct.

Fixes: #8804
Backport: firefly
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rgw: modelines

Signed-off-by: Sage Weil <sage@inktank.com>
doc: Added CentOS/RHEL install for git.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Merge branch 'master' of https://github.com/ceph/ceph
PG::op_must_wait_for_map: pass the epoch rather than the map

have_same_or_newer_map is also modified to accept epoch instead of
map.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
doc/changelog/v0.80.2: include tag

Signed-off-by: Sage Weil <sage@inktank.com>
rbd.cc: Check io-size avoid floating point exception.

In func do_bench_write if io_size is zero,it can cause floating point execption.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbdmap: per-device mount (Closes: #8538)

`/etc/init.d/rbdmap start` was doing `mount -a`. Although (arguably)
`mount -a -O _netdev` could be less disruptive, it's not RBD mapping job to
mount unrelated devices and potentially do it at the wrong time.

Solution is to call `mount {device}` which works as expected and mounts
device even if it given in form `mount /dev/rbd/pool/imagename` while
`/etc/fstab` uses UUID or LABEL notation.

Furthermore this commit

 * fixes global exit code (it was always 0): now it is 0 only when
   all devices were (un)mounted successfully; otherwise non-zero.
 * replaces `mount -a` with per-device post-mapping `mount {dev}`
 * show mapping progress using LSB functions per device instead of for
   {start|stop} invocation.
 * capture output of `(u)mount` (if any) and report it as "info".

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>