]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use stdbool.h instead of hand-rolling our own bool type
authorJeff Layton <jlayton@redhat.com>
Wed, 6 Mar 2019 14:59:45 +0000 (09:59 -0500)
committerNathan Cutler <ncutler@suse.com>
Wed, 16 Oct 2019 10:46:17 +0000 (12:46 +0200)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit 38ebc5d8fcca131a51f7c6041776c736603c9341)

src/include/rados.h
src/mds/locks.c
src/mds/locks.h

index 53320d65410c619ac75152159737e2803a40ed7e..6c8465277da22231520c3d8a1c95b73a94fe232b 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <string.h>
+#include <stdbool.h>
 #include "msgr.h"
 
 /*
@@ -394,7 +395,7 @@ static inline int ceph_osd_op_mode_cache(int op)
 {
        return op & CEPH_OSD_OP_MODE_CACHE;
 }
-static inline int ceph_osd_op_uses_extent(int op)
+static inline bool ceph_osd_op_uses_extent(int op)
 {
        switch(op) {
        case CEPH_OSD_OP_READ:
index c788407fb0af450b7e8844b8becbe3fe798a192d..e057400de25714d340ed32e7c340245b43bc7647 100644 (file)
@@ -1,8 +1,3 @@
-// there must be a better way?
-typedef char bool;
-#define false 0
-#define true  1
-
 #include "include/int_types.h"
 
 #include <string.h>
index 5199326723e64821eb71c5cea42a657ef594b0bb..e6fdc1cfc43e026d6c77629d71cf918d0259c230 100644 (file)
@@ -1,10 +1,10 @@
-
 #ifndef CEPH_MDS_LOCKS_H
 #define CEPH_MDS_LOCKS_H
+#include <stdbool.h>
 
 struct sm_state_t {
   int next;         // 0 if stable
-  char loner;
+  bool loner;
   int replica_state;
   char can_read;
   char can_read_projected;