TrackedOp: remove the init_from_message function

I'm not sure why we ever had this instead of just doing things in the
subclass constructor, and the semantics around it don't make much sense
for anything else (we called mark_event first anyway).

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: introduce a _dump_op_descriptor function

Use this instead of direct access to the Message underneath when dumping
the TrackedOp.

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: rename arrived_at to initiated_at, specify when constructed

Instead of relying on the message's get_recv_stamp, take a timestamp
when the TrackedOp is constructed. Rename get_received_at() -> get_initiated().

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: introduce an _unregistered() function to let implementations clean up

Right now, the OpRequest uses it to clean up Message payload data.

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: do not track a Message

Give it to the OpRequest (currently, the only TrackedOp implementation).

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: do not require a Message when creating new Ops

Further parameterize the template to allow passing in an arbitrary parameter,
and move all the Message-based event marking from there into OpRequest.

Signed-off-by: Greg Farnum <greg@inktank.com>
TrackedOp: create an "initiated" event on construction

This ensures we always have an event for state_string().

Signed-off-by: Greg Farnum <greg@inktank.com>
look for "jni.h" in gcj-jdk path, needed to find "jni.h" with gcj-jdk_4.9.0

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
pass '-classpath' option (gcj/javah ignores CLASSPATH environment variable).

 This should not affect OpenJDK which understands '-classpath' as well.

 With gcj-jdk we still get FTBFS later:

 ~~~~
    java/native/libcephfs_jni.cc:2878:55: error: invalid conversion from 'const jbyte* {aka const signed char*}' to 'jbyte* {aka signed char*}' [-fpermissive]
                 reinterpret_cast<const jbyte*>(rawAddress));
                                                           ^
    In file included from java/native/libcephfs_jni.cc:27:0:
    /usr/lib/gcc/x86_64-linux-gnu/4.8/include/jni.h:1471:8: error:   initializing argument 4 of 'void _Jv_JNIEnv::SetByteArrayRegion(jbyteArray, jsize, jsize, jbyte*)' [-fpermissive]
       void SetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3)
            ^
    make[5] *** [java/native/libcephfs_jni_la-libcephfs_jni.lo] Error 1
 ~~~~

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
prioritise use of `javac` executable (gcj provides it through alternatives).

 On Debian this fixes FTBFS when gcj-jdk and openjdk-7-jdk are installed at
 the same time because build system will use default `javac` executable
 provided by current JDK through `update-alternatives` instead of blindly
 calling GCJ when it is present.

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
mds: remove a couple leftover declarations of MDRequest

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: pass the causative message to request_start_slave()

We were passing the causative MDS (as an int), but pushing down the
actual Message will help us as we set up an OpTracker.

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: add stubs for an AdminSocketHook

Signed-off-by: Greg Farnum <greg@inktank.com>
Mutation: add an MDRequestParams struct and use that when building MDRequests

We now have a single constructor and one path to build MDRequests with.

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: add an OpTracker and use it

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: mark ops at various finish points

Signed-off-by: Greg Farnum <greg@inktank.com>
Server: mark events when journaling and replying

Signed-off-by: Greg Farnum <greg@inktank.com>
Locker: mark_event in acquire_locks() when blocking or succeeding

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: block scrub on blocked object contexts

Fixes: #8011
Backport: firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
mds: add a Server::submit_mdlog_entry() to provide event marking

Signed-off-by: Greg Farnum <greg@inktank.com>