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>
mds: pass finish context to MDlog::submit_entry()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: add get_metablob() to log events

later commits will use it to get EMetaBlob and update EMetaBlob's
event sequence number.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: introduce sequence number for log events

Use the sequence number to index log segments. Later commit will defer
encoding/submitting log events to separate thread, log events' offsets
are unknown before they are encoded.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: print sequence number of log segment
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>
PG::op_mst_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>
shared_cache: use a single lookup for lookup() too

We didn't convert this one to use iterators before.

Signed-off-by: Greg Farnum <greg@inktank.com>
shared_cache: expose prior existence when inserting an element

The LRU now handles you attempting to insert multiple values for the
same key, by telling you that you've done so and returning the
existing value before it manages to muck up existing data.

Signed-off-by: Greg Farnum <greg@inktank.com>
shared_cache: The logic of detecting the presence of an element
in the cache is corrected.

The lower_bound of a map returns an iterator pointing to the
first element that is not less than key. So, if the key is present,
it will point to the exact key and not before key.
The add function logic is changed accordingly.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
shared_cache: The add interface is changed to make param 'existed' as default

Now, the existed param is a default one and default value is NULL.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FDCache: implement a basic sharding of the FDCache

This is just a basic sharding. A more sophisticated implementation would
rely on something other than luck for keeping the distribution equitable.

Signed-off-by: Greg Farnum <greg@inktank.com>
doc: dev: cache-pool.rst: fix typo s/objets/objects/

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
shared_cache: registry_shards type is changed to 'const int'

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FileStore: remove the fdcache_lock

With the changes to the shared_cache, we no longer need the fdcache_lock
to prevent us from inserting a second fd for the same hobject into the cache.

Signed-off-by: Greg Farnum <greg@inktank.com>

Merged conflict fixed.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>

Conflicts:
	src/os/FileStore.cc
shared_cache: pass key (K) by const ref in interface methods

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>