From: John Spray Date: Tue, 25 Mar 2014 13:31:03 +0000 (+0000) Subject: mds: Add get_metablob to LogEvent X-Git-Tag: v0.82~48^2~42 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf7b84c951edbc2c799f66071ca748905341416f;p=ceph.git mds: Add get_metablob to LogEvent Previously the only way to get at the payload of things like EUpdate and EOpen was to replay() them (required a full running MDS) or to use downcasting (yuck). Signed-off-by: John Spray --- diff --git a/src/mds/LogEvent.h b/src/mds/LogEvent.h index 97a4233da6d..1245d256cd1 100644 --- a/src/mds/LogEvent.h +++ b/src/mds/LogEvent.h @@ -48,6 +48,7 @@ class MDS; class LogSegment; +class EMetaBlob; // generic log event class LogEvent { @@ -106,7 +107,11 @@ protected: */ virtual void replay(MDS *m) { assert(0); } - + /** + * If the subclass embeds a MetaBlob, return it here so that + * tools can examine metablobs while traversing lists of LogEvent. + */ + virtual EMetaBlob *get_metablob() {return NULL;} }; inline ostream& operator<<(ostream& out, LogEvent& le) { diff --git a/src/mds/events/EOpen.h b/src/mds/events/EOpen.h index 1267cf0af72..baf93344a23 100644 --- a/src/mds/events/EOpen.h +++ b/src/mds/events/EOpen.h @@ -49,6 +49,7 @@ public: void update_segment(); void replay(MDS *mds); + EMetaBlob *get_metablob() {return &metablob;} }; #endif diff --git a/src/mds/events/EUpdate.h b/src/mds/events/EUpdate.h index 645386e2511..d0be0a4f28b 100644 --- a/src/mds/events/EUpdate.h +++ b/src/mds/events/EUpdate.h @@ -45,6 +45,7 @@ public: void update_segment(); void replay(MDS *mds); + EMetaBlob *get_metablob() {return &metablob;} }; #endif