ceph_test_rados: test read from snapshots

This was disabled back in 2011, c54aa7db3bc6e4c763e3b08d2ae98f89afe5a246.
Whoops!

Signed-off-by: Sage Weil <sage@inktank.com>
osd: preserve user_version in snaps/clones

Signed-off-by: Sage Weil <sage@inktank.com>
crush: fix get_full_location_ordered

This should return -ENOENT when an id is not present.  Broken by
746069ee62c74ecf04ed45988029d5c3382a38d2.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/mon/crush_ops.sh: fix in-use rule rm test

Signed-off-by: Sage Weil <sage@inktank.com>
libcephfs: get osd location on -1 should return EINVAL

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados_api_tier: retry EBUSY race checks

...or else these will occasionally fail against a thrashing cluster.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rest/test.py: rbd pool ruleset is now 0

Signed-off-by: Sage Weil <sage@inktank.com>
spinlock: add generic spinlock implementation

Adds a ceph_spinlock_t implementation that will use pthread_spinlock_t
if available, and otherwise reverts to pthread_mutex_t. Note that this
spinlock is not intended to be used in process-shared memory.

Switches implementation in:

  ceph_context
  SimpleMessenger
  atomic_t

Only ceph_context initialized its spinlock with PTHREAD_PROCESS_SHARED.
However, there does not appear to be any instance in which CephContext
is allocated in shared memory, and thus can use the default private
memory space behavior.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Merge pull request #1004 from ceph/wip-snaps

make ceph_test_rados read from snaps; resulting bugs found

Reviewed-by: Loic Dachary <loic@dachary.org>
Merge pull request #1007 from ceph/wip-misc-fixes

misc fixes

Reviewed-by: Loic Dachary <loic@dachary.org>
kvstore: only build on linux

There are several non-standard errno values used. There is still work to
do on addressing errno portability in Ceph, and this disables kvstore on
non-Linux platforms until that work is complete.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
c++11: fix std::lock naming conflicts

Unfortunately, 'using namespace std;' is in pretty widespread use in the Ceph
tree, so we need to rename to avoid the conflict.

Example error output:

test/streamtest.cc:37:19: error: reference to 'lock' is ambiguous
  Mutex::Locker l(lock);
                  ^
test/streamtest.cc:32:7: note: candidate found by name lookup is 'lock'
Mutex lock("streamtest.cc lock");
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/mutex:346:1: note: candidate found by name lookup is 'std::__1::lock'
lock(_L0& __l0, _L1& __l1)

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
warning: fix typo and -Wmismatched-tags

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
make: use c++ flags for building librados

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
gtest: disable tr1/tuple

Not all compilers are supporting tr1/tuple. This forces libgtest to use
an internal implementation of tuple. Alternatively, the newer 1.6
version of gtest may correctly handle this case automatically.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
test: fix VLA of non-POD type

Variable length array of non-POD type is not supported by clang.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
test: only build some tests on linux

These tests have portability problems that have yet to be solved on
non-Linux systems.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
test: print warning about missing fs features

- sync
- posix_fadvise

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
test: remove platform specific header

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
test: include headers for struct statfs

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>