OSD: cpu optimized the functions
The function signatures are modified to accept parameters by reference
or returning by reference.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Message: constructor initialization list is modified to initialize some
attributes with copy constructor instead of assignment operator in the
constructor body.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FileStore:The redundant fdcache_lock is been removed
This upper level lock seems redundant since lru cache has its own lock
inside. Also, the lock lookup in the lfn_open() is moved up since the
return value of the expensive get_index call is not checked and probably
not necessary (not sure though).

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FDCache: The sharded FDCache implementation
This is the sharded FDCache implemented by Greg. Unfortunately, I don't
have the commit number so I have to copy the implementation like this.
Instead of single lru cache now there are multiple of these lru caches and
the objects are distributed across these caches based on the object hash.

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

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
WorkQueue: Taking care of potential race condition during pause()
Introduced two variables to keep track of number of threads paused
and drained during threadpool pause/drain. The pause()/drain() call
is waiting till number of pause/drain threads equals to toral number of
thread pool threads.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
ReplicatedPG: Read path optimization
We don't need to call get_snapset_context() during read head objects.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FileStore: Index caching is been implemented
IndexManager now has a Index caching. Index will only be created if not
found in the cache. Earlier, each op is creating an Index object and other
ops requesting the same index needed to wait till previous op is done.
Also, after finishing lookup, this Index object was destroyed.
Now, a RWlock is been introduced in the CollectionIndex class and that is
responsible for sync between lookup and create.
Also, since these Index objects are persistent there is no need to use
smart pointers. So, Index is a CollecIndex* now.

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