From 320d9cd82903e9928810a82fee2c7695f8823159 Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 14 Nov 2007 01:49:01 +0000 Subject: [PATCH] ceph_fs.h cleanup, etc. git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2063 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/include/ceph_fs.h | 45 ++++++++++++++++++++++++++++ trunk/ceph/include/ceph_fs_msgs.h | 39 ------------------------ trunk/ceph/messages/MClientSession.h | 8 ++--- trunk/ceph/mkmonmap.cc | 6 ++-- trunk/ceph/msg/Message.h | 3 +- 5 files changed, 53 insertions(+), 48 deletions(-) delete mode 100644 trunk/ceph/include/ceph_fs_msgs.h diff --git a/trunk/ceph/include/ceph_fs.h b/trunk/ceph/include/ceph_fs.h index a0d1c06443f81..dce1e66c3210e 100644 --- a/trunk/ceph/include/ceph_fs.h +++ b/trunk/ceph/include/ceph_fs.h @@ -206,4 +206,49 @@ struct ceph_message_header { __u32 nchunks; }; + +/* + * message types + */ + +/* misc */ +#define CEPH_MSG_SHUTDOWN 1 +#define CEPH_MSG_PING 2 +#define CEPH_MSG_PING_ACK 3 + +/* client <-> monitor */ +#define CEPH_MSG_MON_MAP 4 +#define CEPH_MSG_CLIENT_MOUNT 10 +#define CEPH_MSG_CLIENT_UNMOUNT 11 +#define CEPH_MSG_STATFS 12 +#define CEPH_MSG_STATFS_REPLY 13 + +/* client <-> mds */ +#define CEPH_MSG_MDS_GETMAP 20 +#define CEPH_MSG_MDS_MAP 21 + +#define CEPH_MSG_CLIENT_SESSION 22 // start or stop +#define CEPH_MSG_CLIENT_RECONNECT 23 + +#define CEPH_MSG_CLIENT_REQUEST 24 +#define CEPH_MSG_CLIENT_REQUEST_FORWARD 25 +#define CEPH_MSG_CLIENT_REPLY 26 +#define CEPH_MSG_CLIENT_FILECAPS 0x310 // + +/* osd */ +#define CEPH_MSG_OSD_GETMAP 40 +#define CEPH_MSG_OSD_MAP 41 +#define CEPH_MSG_OSD_OP 42 // delete, etc. +#define CEPH_MSG_OSD_OPREPLY 43 // delete, etc. + + +/* client_session message op values */ +enum { + CEPH_SESSION_REQUEST_OPEN, + CEPH_SESSION_OPEN, + CEPH_SESSION_REQUEST_CLOSE, + CEPH_SESSION_CLOSE +}; + + #endif diff --git a/trunk/ceph/include/ceph_fs_msgs.h b/trunk/ceph/include/ceph_fs_msgs.h deleted file mode 100644 index 4d6985e3b68a4..0000000000000 --- a/trunk/ceph/include/ceph_fs_msgs.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ceph_fs_msgs.h - * - * message types - */ - -#ifndef _FS_CEPH_CEPH_FS_MSGS_H -#define _FS_CEPH_CEPH_FS_MSGS_H - -/* misc */ -#define CEPH_MSG_SHUTDOWN 1 -#define CEPH_MSG_PING 2 -#define CEPH_MSG_PING_ACK 3 - -/* client <-> monitor */ -#define CEPH_MSG_MON_MAP 4 -#define CEPH_MSG_CLIENT_MOUNT 10 -#define CEPH_MSG_CLIENT_UNMOUNT 11 -#define CEPH_MSG_STATFS 12 -#define CEPH_MSG_STATFS_REPLY 13 - -/* client <-> mds */ -#define CEPH_MSG_MDS_GETMAP 20 -#define CEPH_MSG_MDS_MAP 21 - -#define CEPH_MSG_CLIENT_SESSION 22 // start or stop -#define CEPH_MSG_CLIENT_RECONNECT 23 - -#define CEPH_MSG_CLIENT_REQUEST 24 -#define CEPH_MSG_CLIENT_REQUEST_FORWARD 25 -#define CEPH_MSG_CLIENT_REPLY 26 -#define CEPH_MSG_CLIENT_FILECAPS 0x310 // - -/* osd */ -#define CEPH_MSG_OSD_GETMAP 40 -#define CEPH_MSG_OSD_MAP 41 -#define CEPH_MSG_OSD_OP 42 // delete, etc. -#define CEPH_MSG_OSD_OPREPLY 43 // delete, etc. - -#endif diff --git a/trunk/ceph/messages/MClientSession.h b/trunk/ceph/messages/MClientSession.h index 093ff10a9a9d4..2c94f14e09755 100644 --- a/trunk/ceph/messages/MClientSession.h +++ b/trunk/ceph/messages/MClientSession.h @@ -19,10 +19,10 @@ class MClientSession : public Message { public: - const static int OP_REQUEST_OPEN = 1; - const static int OP_OPEN = 2; - const static int OP_REQUEST_CLOSE = 3; - const static int OP_CLOSE = 4; + const static int OP_REQUEST_OPEN = CEPH_SESSION_REQUEST_OPEN; + const static int OP_OPEN = CEPH_SESSION_OPEN; + const static int OP_REQUEST_CLOSE = CEPH_SESSION_REQUEST_CLOSE; + const static int OP_CLOSE = CEPH_SESSION_CLOSE; static const char *get_opname(int o) { switch (o) { case OP_REQUEST_OPEN: return "request_open"; diff --git a/trunk/ceph/mkmonmap.cc b/trunk/ceph/mkmonmap.cc index 0a80e93c40bd2..1e2dd2050c4fa 100644 --- a/trunk/ceph/mkmonmap.cc +++ b/trunk/ceph/mkmonmap.cc @@ -48,19 +48,19 @@ int main(int argc, char **argv) cerr << "mkmonmap: invalid ip:port '" << args[i] << "'" << std::endl; return -1; } - inst.name = entity_name_t::MON(monmap.num_mon); + inst.name = entity_name_t::MON(monmap.size()); cout << "mkmonmap: adding " << inst << std::endl; monmap.add_mon(inst); } } - if (monmap.num_mon == 0) { + if (monmap.size() == 0) { cerr << "usage: mkmonmap ip:port [...]" << std::endl; return -1; } // write it out - cout << "mkmonmap: writing monmap to " << outfn << " (" << monmap.num_mon << " monitors)" << std::endl; + cout << "mkmonmap: writing monmap to " << outfn << " (" << monmap.size() << " monitors)" << std::endl; int r = monmap.write(outfn); assert(r >= 0); diff --git a/trunk/ceph/msg/Message.h b/trunk/ceph/msg/Message.h index 883c09421a4c8..244c07a57fce0 100644 --- a/trunk/ceph/msg/Message.h +++ b/trunk/ceph/msg/Message.h @@ -16,8 +16,7 @@ #define __MESSAGE_H /* public message types */ -#include "include/ceph_fs_msgs.h" - +#include "include/ceph_fs.h" // monitor internal #define MSG_MON_ELECTION 60 -- 2.39.5