Re: [PATCH 24/33] libceph: ceph_osd_{exists,is_up,is_down}(osd) definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/27/2014 01:18 PM, Ilya Dryomov wrote:
> Sync up with ceph.git definitions.  Bring in ceph_osd_is_down().

Looks good.  (Though I didn't verify it matches Ceph's definitions...)

Reviewed-by: Alex Elder <elder@xxxxxxxxxx>

> Signed-off-by: Ilya Dryomov <ilya.dryomov@xxxxxxxxxxx>
> ---
>  include/linux/ceph/osdmap.h |   14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
> index 6e030cb3c9ca..0895797b9e28 100644
> --- a/include/linux/ceph/osdmap.h
> +++ b/include/linux/ceph/osdmap.h
> @@ -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)
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux