ceph.in: handle DYLD_LIBRARY_PATH on OS X

On OS X, the environment variable to override
to .libs is DYLD_LIBRARY_PATH instead of
LD_LIBRARY_PATH.

Signed-off-by: John Spray <john.spray@redhat.com>
common/Thread: add missing #include for pid_t

On linux this worked by side effect from
pthread.h, but POSIX header for pid_t is
sys/types.h -- this is needed on OS X.

Signed-off-by: John Spray <john.spray@redhat.com>
os/FileStore: move ZFS_SUPER_MAGIC in linux ifdef

The __SWORD_TYPE for this line is linux-specific.

Signed-off-by: John Spray <john.spray@redhat.com>
client: handle missing O_RSYNC constant

Although this is part of POSIX, it's missing on
OS X.  #define it to zero in this case so that checks
for the flag will always be false.

Signed-off-by: John Spray <john.spray@redhat.com>
common: move #include syscall into ifndef DARWIN

Signed-off-by: John Spray <john.spray@redhat.com>
os/FileStore: put SUPER usage in ifdef __linux__

This is an update to take account of 9312c5e wherein
the FS_* enum was replaced by direct use of SUPER_MAGIC
macros.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: avoid comparing MutationRef with 0

LLVM on OS X considers this == operator with an int
ambiguous: compare with an explicit MutationRef()
instead.

Signed-off-by: John Spray <john.spray@redhat.com>
Add Header cache to KeyValueStore

In the performance statistic recently, the header lookup becomes the main time
consuming for the read/write operations. Most of time it occur 50% to deal with
header lookup, decode/encode logics.

Now adding header cache using SharedLRU structure which will maintain the header
cache and caller will get the pointer to the real header. It also avoid too much
header copy operations overhead.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Remove exclusive lock on GenericObjectMap

Now most of GenericObjectMap interfaces use header as argument not the union of
coll_t and ghobject_t. So caller should be responsible for maintain the
exclusive header.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
common: seq_read_bench argument order changed
The argument order for seq_read_bench in src/common/obj_bencher.h has
been changed to match the argument order in obj_bencher.cc

Calls to seq_read_bench already use the correct order.
seq_read_bench also matches the order of rand_read_bench and
write_bench

Signed-off-by: Kevin Dalley <kevin@kelphead.org>
Support for READFORWARD in the caching tier

READFORWARD caching policy uses writeback for writes
and redirects reads to the back end starage tier.

Signed-off-by: Luis Pabón <lpabon@redhat.com>
Add random cache and replace SharedLRU in KeyValueStore

SharedLRU plays pool performance in KeyValueStore with large header cache size,
so a performance optimized RandomCache could improve it.

RandomCache will record the lookup frequency of key. When evictint element,
it will randomly compare several elements's frequency and evict the least
one.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Use submit_transaction_sync to make change durable

submit_transaction will use asynchronous write operation, there is no journal
for keyvaluestore so we need to make it sync

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Fix the PG listing issue which could miss objects for EC pool (where there is object shard and generation).
Backport: firefly
Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
Work around an apparent binding bug (GCC 4.8).

A reference to h->seq passed to std::pair ostensibly could not bind
because the header structure is packed.  At first this looked like
a more general unaligned access problem, but the only location the
compiler rejects is a false positive.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Convert ConnectionRef explicitly to bool.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
Add required spacing after string literals (PRIu64).

The common formatting for these 64bit types is not C++ 2011
clean.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>

Conflicts:
	src/common/perf_counters.cc
Remove some not-resolving make_pair() invocations.

There's nothing wrong with make_pair(), but there is some type
resolution issue in these instances, at least with GCC 4.8.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
test: fix make_pair() for c++11

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Add random_cache.hpp to Makefile.am

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>