mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ceph: make logical calculation functions return bool
This patch makes serverl logical caculation functions return bool to improve readability due to these particular functions only using 0/1 as their return value. No functional change. Signed-off-by: Zhang Zhuoyu <zhangzhuoyu@cmss.chinamobile.com>
This commit is contained in:
parent
224a7542b8
commit
3b33f692c8
6 changed files with 9 additions and 9 deletions
|
@ -172,19 +172,19 @@ struct ceph_osdmap {
|
|||
int crush_scratch_ary[CEPH_PG_MAX_SIZE * 3];
|
||||
};
|
||||
|
||||
static inline int ceph_osd_exists(struct ceph_osdmap *map, int osd)
|
||||
static inline bool ceph_osd_exists(struct ceph_osdmap *map, int osd)
|
||||
{
|
||||
return osd >= 0 && osd < map->max_osd &&
|
||||
(map->osd_state[osd] & CEPH_OSD_EXISTS);
|
||||
}
|
||||
|
||||
static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd)
|
||||
static inline bool ceph_osd_is_up(struct ceph_osdmap *map, int osd)
|
||||
{
|
||||
return ceph_osd_exists(map, osd) &&
|
||||
(map->osd_state[osd] & CEPH_OSD_UP);
|
||||
}
|
||||
|
||||
static inline int ceph_osd_is_down(struct ceph_osdmap *map, int osd)
|
||||
static inline bool ceph_osd_is_down(struct ceph_osdmap *map, int osd)
|
||||
{
|
||||
return !ceph_osd_is_up(map, osd);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue