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
FileStore: FDCache lookup is rearranged
In lfn_open() there is no point of building the Index if the
cache lookup is successful. So, it is moved up in the function.

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>
FileStore: Indexmanager lookup optimized
Earlier in get_index() the map.count() followed be map[] operator was used.
This can be expensive since two logarithmic complexity operation.
Now, it is replaced by map.find() to get rid of one logarithmic search.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Test: FileStore test classes are changed to work with the new Index
and interface changes.

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

Conflicts:
	src/test/os/TestLFNIndex.cc
Fixed conflicts.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FileStore: Index pointer was not initialized
Index pointer within _clone() was not initialized to NULL.
This bug was the reason for a hung during an overwrite operation
after creating a snapshot.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
shared_cache: Cache interfaces are cpu optimized
The interfaces are modified to take the parameter
as const ref.

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

Conflicts:
	src/common/shared_cache.hpp

Resolved conflicts

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