debug_mds_balancer: 1,
debug_mds_log: 1,
debug_buffer: 0,
+ debug_filer: 0,
// --- client ---
client_cache_size: 400,
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)
int debug_mds_balancer;
int debug_mds_log;
int debug_buffer;
+ int debug_filer;
// client
int client_cache_size;
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;
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
void flush();
void trim(Context *c);
+ void _did_read();
void _trimmed(LogEvent *le);
};
#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
#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: "
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();