tools: Create cephfs-journal-tool

This is for debugging/repairing CephFS journals.

Signed-off-by: John Spray <john.spray@inktank.com>
rpm: add cephfs-journal-tool to RPM build

Signed-off-by: John Spray <john.spray@inktank.com>
debian: add cephfs-journal-tool to ceph-mds

Signed-off-by: John Spray <john.spray@inktank.com>
gitignore: Add cephfs-journal-tool

Signed-off-by: John Spray <john.spray@inktank.com>
docs: Add cephfs-journal-tool

Signed-off-by: John Spray <john.spray@inktank.com>
mds/CDir: remove redundant inode enc/dec

Use the new CInode::encode_bare/decode_bare fns
in CDir, so that we only have one implementation
of the inode encode/decode code.

Signed-off-by: John Spray <john.spray@inktank.com>
doc: cephfs-journal-tool typos

Signed-off-by: John Spray <john.spray@inktank.com>
osdc: Clean up journalstream readable check

Fix redundant (and subtly incorrect) calculation of
the number of bytes needed.  It worked because waiting
for a few more bytes before reading the entry size
of an old-format entry was harmless.

Signed-off-by: John Spray <john.spray@inktank.com>
osdc: fix redundant branch

Signed-off-by: John Spray <john.spray@inktank.com>
osdc/Journaler: privatize members

Many members were unnecessarily public.

Signed-off-by: John Spray <john.spray@inktank.com>
osdc: Add Journaler.erase

This is used in subsequent commits to delete journals
that are no longer needed, such as after rewriting
a journal in a different format.

Signed-off-by: John Spray <john.spray@inktank.com>
mds: add atomic log rewrite on format change

Two main pieces to this:
 * A new JournalPointer object that stores two journal
   inodes so that we can do a double-buffered update,
   followed by an atomic swap.
 * An extended recovery process in MDLog that dereferences
   the JournalPointer and conditionally rewrites the
   journal to accomodate format updates.

The JournalPointer indirection should also be useful for
making cephfs-journal-tool do updates more safely.

Signed-off-by: John Spray <john.spray@inktank.com>