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>
osdc/Journaler: fix obj count in Journaler:erase

This was off by one (too few) in the case of a
trimmedpos->write_pos range that had length
layout_period+2 and starting position one byte
before a period boundary.

Signed-off-by: John Spray <john.spray@inktank.com>
tools/cephfs: error handling in EventOutput

Print error instead of hitting assertion if
we e.g. can't create directory.

Signed-off-by: John Spray <john.spray@inktank.com>
ceph.spec.in: remove BuildRoot

Deprecated

Fixes: #8143
Signed-off-by: Sage Weil <sage@inktank.com>
mds: add {mds,op}_stamp to Mutation

With getters, setters.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: set mds_stamp on lock acquisition

Normally acquire_locks() will set this for us.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: make sure mds_stamp is set when we journal

This is a catch-all that we are carrying over from before.  It may not
be strictly necessary, but I'm not inclined to check the code for
Mutation users who didn't call acquire_locks().

Signed-off-by: Sage Weil <sage@inktank.com>
mds: do rstat timestamps (rctime, fragstat mtime) in terms of op stamp

Use the op (client) timestamp for the recursive stats, for santity's sake.
Note that since this is monotonically increasing, the danger here is
that we lose track of nested changes due to skewed client clocks.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: do the balancer and propagation timers based on mds_stmap

Use the (more) stable time stamp for doing the balancer's temperature
tracking and associated decay.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: use client-provided time stamp for user-visible file metadata

Use the op_stamp from the MDRequest, populated by the MClientRequest when
possible, for setting timestamps on user-visible metadata (like ctime,
mtime).

Signed-off-by: Sage Weil <sage@inktank.com>
mds: use real timestamp for readdir leases

Signed-off-by: Sage Weil <sage@inktank.com>
mds: reset mds_stamp for readdir, rename, link

These ops to complicated work prior to starting the real operation, like
fetching missing directories, or opening remote dirfrags, creating
snaprealms.  Reset the mds timestamp after this slow work has completed.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: use mds_stamp for mksnap

Use the server timestamp for the snapshot timestamp.  This could arguably
be the client timestamp, but I think snapshot creation times are a bit
more important to have accurate timestamps on, and this should not be
something that existing client apps will strongly depend on.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: remove unused Mutation::now

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