init: add systemd service files

This patch adds systemd service files. It is possible to start and
enable multiple instances (per monid, osdid, mds name), e.g.

 # systemctl start ceph-mon@node01
 # systemctl enable ceph-mon@node01

 # systemctl start ceph-osd@0
 # systemctl enable ceph-osd@0

The ceph cluster can be set in the system config file:

 /etc/sysconfig/ceph

adding or editing the CLUSTER environment variable.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Merge pull request #2154 from simon3z/master

init: add systemd service files

Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Remove reference from mkcephfs.

A bit of colission from spec changes for the rhel7/ceph-common
changes and alfredo's pull request for wip-die-ceph-mkcephfs.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
mds: separate inode recovery queue from MDCache

Refactor to:
* have somewhere to put some logic for doing
  background recovery in future.
* trim a few lines from the oversized MDCache.cc
  whereever we can.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: remove unused purge_prealloc_ino

Signed-off-by: John Spray <john.spray@redhat.com>
mds: make MDS::replay_done clearer

... and add some assertions.

Signed-off-by: John Spray <john.spray@redhat.com>
mds: refactor MDS boot

* Make boot_start private.
* Define boot stages in enum, replace int with type.
* Merge steps 0 and 1, 0 always fell through to 1.
* starting_done was only ever reached by a fall through
  from the previous step, so call it directly from there.
* since fall through is no longer needed, replace switch with
  if/else

Signed-off-by: John Spray <john.spray@redhat.com>
mds: introduce explicit DaemonState instead of int

Signed-off-by: John Spray <john.spray@redhat.com>
mds: handle replaying old format journals

To get back to the reformatting procedure that otherwise
occurs during MDLog::open, introduce an MDLog::reopen call
that MDS can use in the standbyreplay->standby transition
for the special case where the journal is old.

Fixes: #8869

Signed-off-by: John Spray <john.spray@redhat.com>
mds: remove some rogue "using namespace std;"

Signed-off-by: John Spray <john.spray@redhat.com>
common/RWLock: track read/write locks via atomics for assertion checks

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
common/RWLock: check return values

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
common/RWLock: add get()

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
common/RWLock: add explicit unlock() to *Lockers

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
common/RWLock: add lock context

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
time: create RWTimer

a timer implementation that uses RWLock

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
client: adapt to new objecter interface

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
mds: adapt to new objecter interface

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
librados: don't hold lock in dispatch()

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
librados: don't hold client lock in certain operations

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>