]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: switch __u32 with LogEvent::EventType typedef
authorJohn Spray <john.spray@inktank.com>
Tue, 8 Apr 2014 13:15:43 +0000 (14:15 +0100)
committerJohn Spray <john.spray@inktank.com>
Sun, 18 May 2014 10:21:29 +0000 (11:21 +0100)
Signed-off-by: John Spray <john.spray@inktank.com>
src/mds/LogEvent.cc
src/mds/LogEvent.h

index c6c9ce725d189529974b273e5964f954aa23248d..2928a61a78fa67077dd165e0a8cecb5a97e3203c 100644 (file)
@@ -43,7 +43,7 @@ LogEvent *LogEvent::decode(bufferlist& bl)
 {
   // parse type, length
   bufferlist::iterator p = bl.begin();
-  __u32 type;
+  EventType type;
   LogEvent *event = NULL;
   ::decode(type, p);
 
index 6243c2c8ba106e77348591f17b0fc7718d8998e9..1152ade84765446e8d3b01fcf042286e940ae587 100644 (file)
@@ -52,17 +52,20 @@ class EMetaBlob;
 
 // generic log event
 class LogEvent {
- private:
-  __u32 _type;
+public:
+ typedef __u32 EventType;
+
+private:
+  EventType _type;
   uint64_t _start_off;
-  static LogEvent *decode_event(bufferlist& bl, bufferlist::iterator& p, __u32 type);
+  static LogEvent *decode_event(bufferlist& bl, bufferlist::iterator& p, EventType type);
 
 protected:
   utime_t stamp;
 
   friend class MDLog;
 
- public:
+public:
   LogSegment *_segment;
 
   LogEvent(int t)
@@ -70,9 +73,9 @@ protected:
   virtual ~LogEvent() { }
 
   string get_type_str() const;
-  static __u32 str_to_type(std::string const &str);
-  int get_type() const { return _type; }
-  void set_type(int t) { _type = t; }
+  static EventType str_to_type(std::string const &str);
+  EventType get_type() const { return _type; }
+  void set_type(EventType t) { _type = t; }
 
   uint64_t get_start_off() const { return _start_off; }
   void set_start_off(uint64_t o) { _start_off = o; }