]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
whitespaces
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 9 Dec 2008 22:19:27 +0000 (14:19 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 9 Dec 2008 22:19:27 +0000 (14:19 -0800)
src/cobserver.cc
src/mon/ClientMap.h
src/mon/Paxos.cc

index 6f75947be0284d5465ec3ab7c81e02768472ff24..06363f804703b65591e366b7ecfaab2d0ea73255 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 /*
  * Ceph - scalable distributed file system
@@ -7,9 +7,9 @@
  *
  * 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 
+ * License version 2.1, as published by the Free Software
  * Foundation.  See file COPYING.
- * 
+ *
  */
 
 #include <sys/stat.h>
@@ -67,34 +67,6 @@ map<string,string> status;
 
 int lines = 0;
 
-// refresh every second
-void get_status(bool newmon=false);
-
-struct C_Refresh : public Context {
-  void finish(int r) {
-    get_status(true);
-  }
-};
-
-SafeTimer timer(lock);
-Context *event = 0;
-
-void get_status(bool newmon)
-{
-  int mon = monmap.pick_mon(newmon);
-
-  vector<string> vcmd(2);
-  vcmd[0] = prefix[which];
-  vcmd[1] = "stat";
-  
-  MMonCommand *m = new MMonCommand(monmap.fsid);
-  m->cmd.swap(vcmd);
-  messenger->send_message(m, monmap.get_inst(mon));
-
-  event = new C_Refresh;
-  timer.add_event_after(.2, event);
-}
-
 void handle_notify(MMonObserveNotify *notify)
 {
     generic_dout(0) << notify->get_source() << " -> " << get_paxos_name(notify->machine_id) << " v" << notify->ver
@@ -105,8 +77,8 @@ void handle_notify(MMonObserveNotify *notify)
        switch (notify->machine_id) {
        case PAXOS_PGMAP:
                {
-                 PGMap::Incremental inc;
-                 bufferlist::iterator p = notify->bl.begin();
+                  PGMap::Incremental inc;
+                  bufferlist::iterator p = notify->bl.begin();
                  inc.decode(p);
                  pgmap.apply_incremental(inc);
                  break;
@@ -122,7 +94,7 @@ void handle_notify(MMonObserveNotify *notify)
                break;
        case PAXOS_CLIENTMAP:
                {
-                 ClientMap::Incremental inc;
+                  ClientMap::Incremental inc;
                  bufferlist::iterator p = notify->bl.begin();
                  inc.decode(p);
                  clientmap.apply_incremental(inc);
@@ -189,7 +161,7 @@ class Admin : public Dispatcher {
 } dispatcher;
 
 
-void usage() 
+void usage()
 {
   cerr << "usage: covserver [options] monhost] command" << std::endl;
   cerr << "Options:" << std::endl;
@@ -211,11 +183,11 @@ static void send_requests()
 {
    bufferlist indata;
    for (int i=0; i<PAXOS_NUM; i++) {
-       MMonObserve *m = new MMonObserve(monmap.fsid, i, map_ver[i]);
-       m->set_data(indata);
-       int mon = monmap.pick_mon();
-       generic_dout(0) << "mon" << mon << " <- observe " << get_paxos_name(i) << dendl;
-       messenger->send_message(m, monmap.get_inst(mon));
+        MMonObserve *m = new MMonObserve(monmap.fsid, i, map_ver[i]);
+        m->set_data(indata);
+        int mon = monmap.pick_mon();
+        generic_dout(0) << "mon" << mon << " <- observe " << get_paxos_name(i) << dendl;
+        messenger->send_message(m, monmap.get_inst(mon));
   }
 
   C_ObserverRefresh *observe_refresh_event = new C_ObserverRefresh();
@@ -241,7 +213,7 @@ int main(int argc, const char **argv, const char *envp[]) {
   if (mc.get_monmap(&monmap) < 0)
     return -1;
    memset(map_ver, 0, sizeof(map_ver));
-  
+
   // start up network
   rank.bind();
   g_conf.daemonize = false; // not us!
index 239d01a7d6097fd0a67f613fff9ad007864440da..ad6b209ee031ab9f20b66a0a23f193a19c50c31f 100644 (file)
@@ -1,4 +1,4 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 /*
  * Ceph - scalable distributed file system
@@ -7,11 +7,11 @@
  *
  * 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 
+ * License version 2.1, as published by the Free Software
  * Foundation.  See file COPYING.
- * 
+ *
  */
+
 /*
  * The Client Monitor is used for traking the filesystem's clients.
  */
@@ -34,7 +34,7 @@ using namespace std;
 struct client_info_t {
   entity_addr_t addr;
   utime_t mount_time;
-  
+
   void encode(bufferlist& bl) const {
     ::encode(addr, bl);
     ::encode(mount_time, bl);
@@ -77,7 +77,7 @@ public:
       else
        unmount.insert(client);
     }
-    
+
     void encode(bufferlist &bl) const {
       ::encode(version, bl);
       ::encode(next_client, bl);
@@ -112,7 +112,7 @@ public:
        client_info[p->first] = p->second;
        addr_client[p->second.addr] = p->first;
     }
-       
+
     for (set<int32_t>::iterator p = inc.unmount.begin();
           p != inc.unmount.end();
           ++p) {
index ff1b78d825b1948e2adc909b2b51a57f5b1afe85..7ff36a82072844214198ae28162396c7474a5bd8 100644 (file)
@@ -773,7 +773,7 @@ void Paxos::dispatch(Message *m)
         (mon->is_peon() && m->get_source().num() == mon->get_leader()));
   
   switch (m->get_type()) {
-    
+
   case MSG_MON_PAXOS:
     {
       MMonPaxos *pm = (MMonPaxos*)m;