mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
libceph: ceph_osd_{exists,is_up,is_down}(osd) definitions
Sync up with ceph.git definitions. Bring in ceph_osd_is_down(). Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
This commit is contained in:
parent
ddf3a21a03
commit
246138fa67
1 changed files with 13 additions and 1 deletions
|
@ -125,9 +125,21 @@ static inline void ceph_oid_copy(struct ceph_object_id *dest,
|
|||
dest->name_len = src->name_len;
|
||||
}
|
||||
|
||||
static inline int 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)
|
||||
{
|
||||
return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP);
|
||||
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)
|
||||
{
|
||||
return !ceph_osd_is_up(map, osd);
|
||||
}
|
||||
|
||||
static inline bool ceph_osdmap_flag(struct ceph_osdmap *map, int flag)
|
||||
|
|
Loading…
Reference in a new issue