]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 1 Jul 2005 16:07:16 +0000 (16:07 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 1 Jul 2005 16:07:16 +0000 (16:07 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@374 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/config.cc
ceph/config.h
ceph/mds/LogStream.cc
ceph/mds/MDLog.cc
ceph/mds/MDLog.h
ceph/osd/FakeStore.cc
ceph/osdc/Filer.cc

index da72f44ccf6e901fc849e33d230fa9d174e9e462..fba8bf58971572be83ac7e9abf7c5d60e31af63a 100644 (file)
@@ -50,6 +50,7 @@ md_config_t g_conf = {
   debug_mds_balancer: 1,
   debug_mds_log: 1,
   debug_buffer: 0,
+  debug_filer: 0,
   
   // --- client ---
   client_cache_size: 400,
@@ -151,6 +152,9 @@ void parse_config_options(int argc, char **argv,
          g_conf.debug_mds_log = atoi(argv[++i]);
        else if (strcmp(argv[i], "--debug_buffer") == 0) 
          g_conf.debug_buffer = atoi(argv[++i]);
+       else if (strcmp(argv[i], "--debug_filer") == 0) 
+         g_conf.debug_filer = atoi(argv[++i]);
+
        else if (strcmp(argv[i], "--log") == 0) 
          g_conf.log = atoi(argv[++i]);
        else if (strcmp(argv[i], "--log_name") == 0) 
index 0a39279bd17d2e266eb820ee94a737aca516e9b9..6a4a84ff8cedfeca5456b0c7e4ea738ec4ab32ad 100644 (file)
@@ -26,6 +26,7 @@ struct md_config_t {
   int debug_mds_balancer;
   int debug_mds_log;
   int debug_buffer;
+  int debug_filer;
 
   // client
   int      client_cache_size;
index 991a3666c322acf72a671897b536a489630c0a29..26f6ad35fb7d9c0c3c9b1080750dcc719f074ba0 100644 (file)
@@ -236,7 +236,7 @@ void LogStream::wait_for_next_event(Context *c)
 
 void LogStream::_did_read(bufferlist& blist)
 {
-  dout(15) << "_did_read got " << blist.length() << " bytes" << endl;
+  dout(15) << "_did_read got " << blist.length() << " bytes at offset " << (read_pos + read_buf.length()) << endl;
   read_buf.claim_append(blist);
 
   list<Context*> finished;
index b0d4cef6b5f06f5664e38e2bf975d22f25ab2ba9..48ba97f8e8a165bf6eb25dffbb3c8ef5b5cd0f28 100644 (file)
@@ -113,12 +113,18 @@ public:
        mdl = m; 
   }
   void finish(int res) {
-       mdl->waiting_for_read = false;
-       mdl->trim(0);
+       mdl->_did_read();
   }
 };
 
 
+void MDLog::_did_read() 
+{
+  dout(5) << "_did_read()" << endl;
+  waiting_for_read = false;
+  trim(0);
+}
+
 void MDLog::trim(Context *c)
 {
   // add waiter
index 6420422954cf2a45367b2d529aeb58fbec0bdd2a..512243196774e37809357336491779e8765e7f67 100644 (file)
@@ -70,6 +70,7 @@ class MDLog {
   void flush();
 
   void trim(Context *c);
+  void _did_read();
   void _trimmed(LogEvent *le);
 };
 
index a61ecd3f4bf8321437e4fee0751af3002a30616d..4f995fa0166cd7be00dd28c7af0dc5c48b343c40 100644 (file)
@@ -2,6 +2,7 @@
 #include "FakeStore.h"
 #include "include/types.h"
 
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #define  dout(l)    if (l<=g_conf.debug) cout << "osd" << whoami << ".fakestore "
 
 
+// crap-a-crap hash
 #define HASH_DIRS       128LL
-#define HASH_FUNC(x)    (((x)/13LL)%HASH_DIRS)
-
+#define HASH_FUNC(x)    (((x) ^ ((x)>>30) ^ ((x)>>18) ^ ((x)>>45) ^ 0xdead1234) * 884811 % HASH_DIRS)
+// end crap hash
 
 
 
index 9d41b971ae0fdb804ad9f97c00a0ba0df5f1c161..571a784f10c965e6b4bc06e9b868ed64d7863022 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "include/config.h"
 #undef dout
-#define dout(x)  if (x <= g_conf.debug) cout << "filer: "
+#define dout(x)  if (x <= g_conf.debug || x <= g_conf.debug_filer) cout << "filer: "
 
 
 
@@ -132,13 +132,13 @@ Filer::handle_osd_read_reply(MOSDOpReply *m)
   PendingOSDRead_t *p = op_reads[ tid ];
   op_reads.erase( tid );
 
-  // what buffer offset are we?
-  size_t off = p->read_off[tid];
-  dout(7) << "got frag at " << off << " len " << m->get_length() << endl;
-  
   // our op finished
   p->outstanding_ops.erase(tid);
   
+  // what buffer offset are we?
+  size_t off = p->read_off[tid];
+  dout(7) << "got frag at " << off << " len " << m->get_length() << ", still have " << p->outstanding_ops.size() << " more ops" << endl;
+  
   if (p->outstanding_ops.empty()) {
        // all done
        p->read_result->clear();