LFNIndex, HashIndex: Introduced a fast lookup path

This look up path is very much cpu optimized and saved ~2 cpu cores.
Can't replace the original look up as the semantics are used from
different parts of the code base. This is used in the IO path right now
as this is critical for performance.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
LFNIndex:overloaded some functions to support the fast path optimization

lfn_generate_object_name() is the main cpu eater. Cpu optimized it.
lfn_get_name() was very generic,so, overloaded it to work optimally
with IO path.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
IndexManager: Introduced a fast path for getting the file descriptor

Introduced a map for holding the HashIndex objects rather than creating
it every time. After getting the object, it will call fast_lookup on that.
It returns the fd and the full filesystem path (if asked) to the caller.
If there is no upgrade is going on this function is invoked by lfn_open()
in the read path.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
FileStore: overloaded lfn_open() for the fast path

Introduced an overloaded cpu optimized and performance optimized
lfn_open(). Got rid of FDCache stuff as that was serializing the requests
and also not gaining much performance wise. The fast path will only be
executed if there is no upgrade is going on.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
FileStore: The getattr and read interface changed

getattr and read ObjectStore interfaces are changed to accomodate two
new parameters, the file descriptor and the full filesystem path.
For getattr, these two out params are default to NULL and if the caller
is populating those other than NULL value, getattr will send the caller
the file descriptor and the file system path.
For read, these two in params are default to -1 and NULL respectively.
If caller supplies valid values for fd , it will try to read from
that fd first. Upon failing, it will try to open directly the filepath
(if not empty). If that also fails, it is calling lfn_open().
There is a config option filestore_use_fd_cache to switch between
old and new interface of lfn_open().

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
MemStore: use the new ObjectStore interface

So that we can build.

Signed-off-by: Greg Farnum <greg@inktank.com>
PGBackend: The interface is changed to call the new getattr Objectstore
interface. Two new outparams are added and both is default to NULL.

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

Conflicts:

	src/osd/PGBackend.h
	src/osd/ReplicatedBackend.h
Signed-off-by: Greg Farnum <greg@inktank.com>
PGBackend: use the new fast read ObjectStore interface for objects_sync_read()

Just like we did for getattr().

Signed-off-by: Greg Farnum <greg@inktank.com>
PG: The read IO path is calling new getattr/read interface

get_object_context() is modified to take an extra default param
whether snapshot is needed or not. In the find_object_context(), if the
request is coming for only head and it is a read request , we don't need
to go for the get_snapset_context() call. This is the path for the read
IO as well. So, in this case, the new getattr interface is called and
the fd/filepath value are stored within ObjectState class. The same value
is passed during the filestore::read call.

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

Conflicts:

	src/osd/ReplicatedPG.cc

Signed-off-by: Greg Farnum <greg@inktank.com>
PG: get_snapset_context() is optimized to hold the lock for shorter
duration.

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
PG: do_op() is cpu optimized

Creating hobject_t is expensive and since we are already creating snapdir
and head object earlier, we are resuing those based on the request snap_id.

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

Conflicts:

	src/osd/ReplicatedPG.cc

Signed-off-by: Greg Farnum <greg@inktank.com>
PG: The reset_obs is not required any more as the OpContext constructor
is taking care of creating ObjectState objects.

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