From: Joao Eduardo Luis Date: Fri, 8 May 2015 14:57:08 +0000 (+0100) Subject: mon: MonCommand: add FLAG_NONE X-Git-Tag: v9.0.3~21^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0438bdd54bf1ff30ee6efb3b9c666943609cd778;p=ceph.git mon: MonCommand: add FLAG_NONE 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 --- diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index c28cec91a658..e52fbba58ed8 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -107,6 +107,7 @@ * 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 */ diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 09a46db69ad1..9bc21e946f39 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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 diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index fb867eade113..d03f45f1fa39 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -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; }