]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: kill unused MAuthMon[Ack]
authorSage Weil <sage@newdream.net>
Thu, 22 Oct 2009 19:56:33 +0000 (12:56 -0700)
committerSage Weil <sage@newdream.net>
Thu, 22 Oct 2009 19:56:33 +0000 (12:56 -0700)
src/messages/MAuthMon.h [deleted file]
src/messages/MAuthMonAck.h [deleted file]
src/mon/AuthMonitor.cc
src/mon/AuthMonitor.h
src/mon/Monitor.cc
src/msg/Message.h

diff --git a/src/messages/MAuthMon.h b/src/messages/MAuthMon.h
deleted file mode 100644 (file)
index ebdfb94..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
- * Foundation.  See file COPYING.
- * 
- */
-
-#ifndef __MAUTHMON_H
-#define __MAUTHMON_H
-
-#include "messages/PaxosServiceMessage.h"
-
-enum {
-   AUTH_NOOP = 0,
-   AUTH_GET,
-   AUTH_SET,
-   AUTH_RESPONSE,
-};
-
-class MAuthMon : public PaxosServiceMessage {
-public:
-  ceph_fsid_t fsid;
-  deque<pair<EntityName, EntityAuth> > info;
-  deque<bool> add;
-  version_t last;
-  __s32 action;
-
-
-  MAuthMon() : PaxosServiceMessage(MSG_AUTHMON, 0) {}
-  MAuthMon(const ceph_fsid_t& f, version_t l) : PaxosServiceMessage(MSG_AUTHMON, 0), fsid(f), last(l) {}
-  MAuthMon(const ceph_fsid_t& f, version_t l, version_t paxos_version) :
-    PaxosServiceMessage(MSG_AUTHMON, paxos_version), fsid(f), last(l) {}
-
-  const char *get_type_name() { return "class"; }
-  void print(ostream& out) {
-    out << "class(";
-    switch (action) {
-    case AUTH_NOOP:
-       out << "NOOP, ";
-       break;
-    case AUTH_GET:
-       out << "GET, ";
-       break;
-    case AUTH_SET:
-       out << "SET, ";
-       break;
-    case AUTH_RESPONSE:
-       out << "RESPONSE, ";
-       break;
-    default:
-       out << "Unknown op, ";
-       break;
-    }
-    if (info.size())
-      out << info.size() << " entries";
-    if (last)
-      out << "last " << last;
-    out << ")";
-  }
-
-  void encode_payload() {
-    paxos_encode();
-    ::encode(fsid, payload);
-    ::encode(info, payload);
-    ::encode(add, payload);
-    ::encode(last, payload);
-    ::encode(action, payload);
-  }
-  void decode_payload() {
-    bufferlist::iterator p = payload.begin();
-    paxos_decode(p);
-    ::decode(fsid, p);
-    ::decode(info, p);
-    ::decode(add, p);
-    ::decode(last, p);
-    ::decode(action, p);
-  }
-};
-
-#endif
diff --git a/src/messages/MAuthMonAck.h b/src/messages/MAuthMonAck.h
deleted file mode 100644 (file)
index 403543c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
- * Foundation.  See file COPYING.
- * 
- */
-
-#ifndef __MAUTHMONACK_H
-#define __MHAUTHMONACK_H
-
-class MAuthMonAck : public PaxosServiceMessage {
-public:
-  ceph_fsid_t fsid;
-  version_t last;
-  
-  MAuthMonAck() : PaxosServiceMessage(MSG_AUTHMON_ACK, 0) {}
-  MAuthMonAck(ceph_fsid_t& f, version_t l) : PaxosServiceMessage(MSG_AUTHMON_ACK, 0),
-                                          fsid(f), last(l) {}
-
-  MAuthMonAck(ceph_fsid_t& f, version_t l, version_t paxos_version) :
-    PaxosServiceMessage(MSG_AUTHMON_ACK, paxos_version), fsid(f), last(l) {}
-
-
-  const char *get_type_name() { return "auth_mon_ack"; }
-  void print(ostream& out) {
-    out << "auth_mon(last " << last << ")";
-  }
-
-  void encode_payload() {
-    paxos_encode();
-    ::encode(fsid, payload);
-    ::encode(last, payload);
-  }
-  void decode_payload() {
-    bufferlist::iterator p = payload.begin();
-    paxos_decode(p);
-    ::decode(fsid, p);
-    ::decode(last, p);
-  }
-};
-
-#endif
index 60c66ce47b4aedde67ec0830a6331d90bbe8618e..0aedb7d0f32d7466a1656ad7ac54c4d19f24480e 100644 (file)
@@ -20,8 +20,6 @@
 #include "messages/MMonCommand.h"
 #include "messages/MAuth.h"
 #include "messages/MAuthReply.h"
-#include "messages/MAuthMon.h"
-#include "messages/MAuthMonAck.h"
 #include "messages/MAuthRotating.h"
 
 #include "common/Timer.h"
@@ -230,9 +228,6 @@ bool AuthMonitor::preprocess_query(PaxosServiceMessage *m)
   case MSG_AUTH_ROTATING:
     return preprocess_auth_rotating((MAuthRotating *)m);
 
-  case MSG_AUTHMON:
-    return preprocess_auth_mon((MAuthMon*)m);
-
   default:
     assert(0);
     delete m;
@@ -246,8 +241,6 @@ bool AuthMonitor::prepare_update(PaxosServiceMessage *m)
   switch (m->get_type()) {
   case MSG_MON_COMMAND:
     return prepare_command((MMonCommand*)m);
-  case MSG_AUTHMON:
-    return prepare_auth_mon((MAuthMon*)m);
   default:
     assert(0);
     delete m;
@@ -333,58 +326,6 @@ bool AuthMonitor::preprocess_auth_rotating(MAuthRotating *m)
   return true;
 }
 
-
-// auth mon
-
-bool AuthMonitor::preprocess_auth_mon(MAuthMon *m)
-{
-  dout(10) << "preprocess_auth_mon " << *m << " from " << m->get_orig_source() << dendl;
-  
-  int num_new = 0;
-  for (deque<pair<EntityName,EntityAuth> >::iterator p = m->info.begin();
-       p != m->info.end();
-       p++)
-    if (!mon->key_server.contains(p->first))
-      num_new++;
-  if (!num_new) {
-    dout(10) << "  nothing new" << dendl;
-    return true;
-  }
-  return false;
-}
-
-bool AuthMonitor::prepare_auth_mon(MAuthMon *m) 
-{
-  dout(10) << "prepare_auth " << *m << " from " << m->get_orig_source() << dendl;
-
-  if (ceph_fsid_compare(&m->fsid, &mon->monmap->fsid)) {
-    dout(0) << "handle_auth on fsid " << m->fsid << " != " << mon->monmap->fsid << dendl;
-    delete m;
-    return false;
-  }
-  for (deque<pair<EntityName,EntityAuth> >::iterator p = m->info.begin();
-       p != m->info.end(); p++) {
-    dout(10) << " writing auth " << *p << dendl;
-    
-    KeyServerData::Incremental inc;
-    inc.name = p->first;
-    inc.auth = p->second;
-    assert(m->action == AUTH_SET);
-    inc.op = KeyServerData::AUTH_INC_ADD;
-    pending_auth.push_back(inc);
-  }
-
-  paxos->wait_for_commit(new C_Auth(this, m, m->get_orig_source_inst()));
-  return true;
-}
-
-void AuthMonitor::_updated_auth(MAuthMon *m, entity_inst_t who)
-{
-  dout(7) << "_updated_auth for " << who << dendl;
-  mon->messenger->send_message(new MAuthMonAck(m->fsid, m->last), who);
-  delete m;
-}
-
 void AuthMonitor::auth_usage(stringstream& ss)
 {
   ss << "error: usage:" << std::endl;
index d45df498e014ef10c52dae20a08afb8a1ced2cdd..3dae5f64c71c62bf1d082784adc621f1ad2fe372 100644 (file)
@@ -52,20 +52,6 @@ class AuthMonitor : public PaxosService {
 
   bool preprocess_auth_rotating(MAuthRotating *m);
 
-  bool preprocess_auth_mon(MAuthMon *m);
-  bool prepare_auth_mon(MAuthMon *m);
-  void _updated_auth(MAuthMon *m, entity_inst_t who);
-
-  struct C_Auth : public Context {
-    AuthMonitor *authmon;
-    MAuthMon *ack;
-    entity_inst_t who;
-    C_Auth(AuthMonitor *p, MAuthMon *a, entity_inst_t w) : authmon(p), ack(a), who(w) {}
-    void finish(int r) {
-      authmon->_updated_auth(ack, who);
-    }    
-  };
-
   bool preprocess_command(MMonCommand *m);
   bool prepare_command(MMonCommand *m);
 
index 93f30134ed1c0f06586dd294c5f48ee22f2fa1c0..794a62d4f9cf2d789aac1a546f62e3dc9c6108c8 100644 (file)
@@ -546,7 +546,6 @@ bool Monitor::ms_dispatch(Message *m)
       // auth
     case CEPH_MSG_AUTH:
     case MSG_AUTH_ROTATING:
-    case MSG_AUTHMON:
       paxos_service[PAXOS_AUTH]->dispatch((PaxosServiceMessage*)m);
       break;
 
index 82f889bef0dd7a201dfd8c025e2f47d4532efb03..5baf48c03928461c0b7b8202ba2a503ce583fb46 100644 (file)
@@ -36,8 +36,6 @@
 #define MSG_GETPOOLSTATS           58
 #define MSG_GETPOOLSTATSREPLY      59
 
-#define MSG_AUTHMON                60
-#define MSG_AUTHMON_ACK            61
 #define MSG_AUTH_ROTATING          62
 
 #define MSG_POOLOP                 49