From a4f0f74466481c98ae6e784c5a43db6ac3f58253 Mon Sep 17 00:00:00 2001 From: sageweil Date: Fri, 12 Oct 2007 18:48:17 +0000 Subject: [PATCH] monmap, mdsmap git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1928 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/kernel/mdsmap.h | 46 ++++++++++++++++++++++++++++++++++++++ trunk/ceph/kernel/monmap.h | 21 +++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 trunk/ceph/kernel/mdsmap.h create mode 100644 trunk/ceph/kernel/monmap.h diff --git a/trunk/ceph/kernel/mdsmap.h b/trunk/ceph/kernel/mdsmap.h new file mode 100644 index 0000000000000..4b3cb8460a9a1 --- /dev/null +++ b/trunk/ceph/kernel/mdsmap.h @@ -0,0 +1,46 @@ +/* -*- mode:C++; tab-width:8; c-basic-offset:8; indent-tabs-mode:t -*- + * vim: ts=8 sw=8 smarttab + */ + +#ifndef _FS_CEPH_MDSMAP_H +#define _FS_CEPH_MDSMAP_H + +/* see mds/MDSMap.h */ +#define CEPH_MDS_STATE_DNE 0 /* down, never existed. */ +#define CEPH_MDS_STATE_STOPPED -1 /* down, once existed, but no subtrees. empty log. */ +#define CEPH_MDS_STATE_FAILED 2 /* down, active subtrees needs to be recovered. */ + +#define CEPH_MDS_STATE_BOOT -3 /* up, boot announcement. destiny unknown. */ +#define CEPH_MDS_STATE_STANDBY -4 /* up, idle. waiting for assignment by monitor. */ +#define CEPH_MDS_STATE_CREATING -5 /* up, creating MDS instance (new journal, idalloc..). */ +#define CEPH_MDS_STATE_STARTING -6 /* up, starting prior stopped MDS instance. */ + +#define CEPH_MDS_STATE_REPLAY 7 /* up, starting prior failed instance. scanning journal. */ +#define CEPH_MDS_STATE_RESOLVE 8 /* up, disambiguating distributed operations (import, rename, etc.) */ +#define CEPH_MDS_STATE_RECONNECT 9 /* up, reconnect to clients */ +#define CEPH_MDS_STATE_REJOIN 10 /* up, replayed journal, rejoining distributed cache */ +#define CEPH_MDS_STATE_ACTIVE 11 /* up, active */ +#define CEPH_MDS_STATE_STOPPING 12 /* up, exporting metadata (-> standby or out) */ + +/* + * mds map + * + * fields limited to those the client cares about + */ +struct ceph_mdsmap { + __u64 m_epoch; + __u64 m_same_in_set_since; + struct timeval m_created; + __u32 m_anchortable; + __u32 m_root; + struct ceph_entity_addr *m_addr; /* array of addresses */ + __u8 *m_state; /* array of states */ + __u32 m_max_mds; /* size of m_addr, m_state arrays */ +}; + +extern int ceph_mdsmap_get_random_mds(ceph_mdsmap *m); +extern int ceph_mdsmap_get_state(ceph_mdsmap *m, int w); +extern struct ceph_entity_addr *ceph_mdsmap_get_addr(ceph_mdsmap *m, int w); +extern int ceph_mdsmap_decode(ceph_mdsmap *m, iovec *v); + +#endif diff --git a/trunk/ceph/kernel/monmap.h b/trunk/ceph/kernel/monmap.h new file mode 100644 index 0000000000000..9f7e535264a8e --- /dev/null +++ b/trunk/ceph/kernel/monmap.h @@ -0,0 +1,21 @@ +/* -*- mode:C++; tab-width:8; c-basic-offset:8; indent-tabs-mode:t -*- + * vim: ts=8 sw=8 smarttab + */ + +#ifndef _FS_CEPH_MONMAP_H +#define _FS_CEPH_MONMAP_H + +/* + * monitor map + */ +struct ceph_monmap { + __u64 m_epoch; + __u32 m_num_mon; + __u32 m_last_mon; + struct ceph_entity_inst m_mon_inst; +}; + +extern int ceph_monmap_pick_mon(ceph_monmap *m); +extern int ceph_monmap_decode(ceph_monmap *m, iovec *v); + +#endif -- 2.39.5