]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MonCommand: add FLAG_NONE
authorJoao Eduardo Luis <joao@suse.de>
Fri, 8 May 2015 14:57:08 +0000 (15:57 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 11:20:02 +0000 (12:20 +0100)
Instead of passing '0' for commands without flags, pass FLAG_NONE
instead.  It's prettier and more obvious -- and it only costs 64 bits.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/MonCommands.h
src/mon/Monitor.cc
src/mon/Monitor.h

index c28cec91a6582835c8572dca3d0ee43a4d613cb8..e52fbba58ed81fb83bfb87ff93cece2864de48d9 100644 (file)
  * The flag parameter for COMMAND_WITH_FLAGS macro must be passed using
  * FLAG(f), where 'f' may be one of the following:
  *
+ *  NONE      - no flag assigned
  *  NOFORWARD - command may not be forwarded
  */
 
index 09a46db69ad1a045f0309310ab00be784d0040d3..9bc21e946f39aa3e3d287737031fb06dc70762c9 100644 (file)
@@ -102,7 +102,7 @@ const string Monitor::MONITOR_STORE_PREFIX = "monitor_store";
 MonCommand mon_commands[] = {
 #define FLAG(f) (MonCommand::FLAG_##f)
 #define COMMAND(parsesig, helptext, modulename, req_perms, avail)      \
-  {parsesig, helptext, modulename, req_perms, avail, 0},
+  {parsesig, helptext, modulename, req_perms, avail, FLAG(NONE)},
 #define COMMAND_WITH_FLAG(parsesig, helptext, modulename, req_perms, avail, flags) \
   {parsesig, helptext, modulename, req_perms, avail, flags},
 #include <mon/MonCommands.h>
index fb867eade11349d2442669225f22f9d2160ca8f2..d03f45f1fa39f31218aa4eacfadee67696d33f6a 100644 (file)
@@ -946,6 +946,7 @@ struct MonCommand {
   uint64_t flags;
 
   // MonCommand flags
+  static const uint64_t FLAG_NONE       = 0;
   static const uint64_t FLAG_NOFORWARD  = 1 << 0;
   
   bool has_flag(uint64_t flag) const { return (flags & flag) != 0; }