osdc/Journaler: use pointers for out params

Fixes a style violation in the new JournalStream class.

Signed-off-by: John Spray <john.spray@inktank.com>
doc: Update ceph-mds manpage

Add missing --hot-standby and --journal-check
arguments.

Fixes: #8258
osdc/JournalStream: DRY envelope size calc

Replace repetitive sizeof() calculation for the
envelope overhead per log event with #defines.

Signed-off-by: John Spray <john.spray@inktank.com>
osdc: make JournalStream::readable const

Signed-off-by: John Spray <john.spray@inktank.com>
osdc: Simplify JournalStream::read

It was doing an unnecessary series of splices() after
reading header, replace with a single pass through
the data and one splice at the end.

Signed-off-by: John Spray <john.spray@inktank.com>
osdc: new style encoding for Journal::Header

Switch to the ENCODE_START, DECODE_START macros
for Journal::Header.  As well as being nice generally,
this has the important side effect of making
journal headers written since JOURNAL_FORMAT_RESILIENT
unreadable to older MDSs, as they will fail their check
on Header.magic.

Signed-off-by: John Spray <john.spray@inktank.com>
mds: Make EMetaBlob::dirlump::_decode_bits const

This requires making the late-decoded attributes mutable.
The motivation is to allow get_paths and all the code downstream
of that to be const too.

Signed-off-by: John Spray <john.spray@inktank.com>
mds: Create JournalPointer in MDLog::create

Otherwise it is created at next startup when
we see that it is missing: this is cleaner.

Signed-off-by: John Spray <john.spray@inktank.com>
tools/JournalTool: Fix 'header set' corner case

If the write_pos was behind the other pointers, we
would flag the header as invalid.  However, that
would prevent doing a "header set" to correct it.

Signed-off-by: John Spray <john.spray@inktank.com>
qa: Add smoke test for cephfs-journal-tool

Signed-off-by: John Spray <john.spray@inktank.com>
tools/JournalTool: update usage()

Signed-off-by: John Spray <john.spray@inktank.com>
tools/MDSUtility: fix crash on bad config

Was calling messenger destructor before
calling shutdown in case where config
was bad, e.g. in vstart without "-c" flag.

Signed-off-by: John Spray <john.spray@inktank.com>
tools/cephfs-journal-tool: handle --help cleanly

Handle --help before main initialization so that
it works with or without a running mon cluster.

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