1 #ifndef _FS_CEPH_MDSMAP_H
2 #define _FS_CEPH_MDSMAP_H
5 #include <linux/ceph/types.h>
8 * mds map - describe servers in the mds cluster.
10 * we limit fields to those the client actually xcares about
12 struct ceph_mds_info
{
14 struct ceph_entity_addr addr
;
16 int num_export_targets
;
22 u32 m_epoch
, m_client_epoch
, m_last_failure
;
24 u32 m_session_timeout
; /* seconds */
25 u32 m_session_autoclose
; /* seconds */
27 u32 m_max_mds
; /* size of m_addr, m_state arrays */
29 struct ceph_mds_info
*m_info
;
31 /* which object pools file data can be stored in */
32 int m_num_data_pg_pools
;
41 static inline struct ceph_entity_addr
*
42 ceph_mdsmap_get_addr(struct ceph_mdsmap
*m
, int w
)
44 if (w
>= m
->m_num_mds
)
46 return &m
->m_info
[w
].addr
;
49 static inline int ceph_mdsmap_get_state(struct ceph_mdsmap
*m
, int w
)
52 if (w
>= m
->m_num_mds
)
53 return CEPH_MDS_STATE_DNE
;
54 return m
->m_info
[w
].state
;
57 static inline bool ceph_mdsmap_is_laggy(struct ceph_mdsmap
*m
, int w
)
59 if (w
>= 0 && w
< m
->m_num_mds
)
60 return m
->m_info
[w
].laggy
;
64 extern int ceph_mdsmap_get_random_mds(struct ceph_mdsmap
*m
);
65 extern struct ceph_mdsmap
*ceph_mdsmap_decode(void **p
, void *end
);
66 extern void ceph_mdsmap_destroy(struct ceph_mdsmap
*m
);
67 extern bool ceph_mdsmap_is_cluster_available(struct ceph_mdsmap
*m
);