Cache ObjectContexts across OSDOps

ObjectContext is constructed when op begins and destroyed when op finished, it costs about 100us each op.

This patch will cache the ObjectContext in a RandomCache to keep it in memory, and trim the cache when its correspondent object is removed or the cache count reach the osd_object_context_caches_count whose default is 4096.

This patch will reduce nearly 100us for each IO if hit cache.

Signed-off-by: Dong Yuan <yuandong1222@gmail.com>
Thanks for your suggestions. :)

In our opinion, when object is removed, its ctx should be trimed as fast as possible to free the memory. It may be useful for situation such as rbd image deteled.

The trim operation just dec the reference of its SharedPtr, so I think it won't cause any incorrect behavior. But as you said, set ctx->trim_obc_cache flag after the deleted operation may be not appropriate, Or maybe I can use ObjectState.exists instead?