From: sage Date: Tue, 28 Jun 2005 04:33:00 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.1~2031 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89e4c2450f77b5fc1dc06dac7b25596555921d01;p=ceph.git *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@350 29311d96-e01e-0410-9327-a35deaab8ce9 --- diff --git a/ceph/Makefile b/ceph/Makefile index d88159fd3ef8..5931de444ac8 100644 --- a/ceph/Makefile +++ b/ceph/Makefile @@ -110,7 +110,7 @@ tcpsyn: tcpsyn.cc mds/allmds.o client/Client.o client/SyntheticClient.o osd/OSD. ${MPICC} ${MPICFLAGS} ${MPILIBS} $^ -o $@ obfstest: tcpsyn.cc mds/allmds.o client/Client.o client/SyntheticClient.o osd/OSD.cc osd/OBFSStore.o msg/TCPMessenger.cc ${COMMON_OBJS} - ${MPICC} -DUSE_OBFS ${MPICFLAGS} ${MPILIBS} $^ -o $@ ./lib/uofs.a + ${MPICC} -DUSE_OBFS ${MPICFLAGS} ${MPILIBS} $^ -o $@ ../uofs/uofs.a fakesyn: fakesyn.cc mds/allmds.o client/Client.o client/SyntheticClient.o osd/OSD.o msg/FakeMessenger.o ${COMMON_OBJS} ${CC} -pg ${CFLAGS} ${LIBS} $^ -o $@ diff --git a/ceph/client/Client.cc b/ceph/client/Client.cc index 44cd13df00d7..b9dccc094ab6 100644 --- a/ceph/client/Client.cc +++ b/ceph/client/Client.cc @@ -465,7 +465,7 @@ int Client::mount(int mkfs) assert(!mounted); // caller is confused? - dout(1) << "mounting" << endl; + dout(2) << "mounting" << endl; MClientMount *m = new MClientMount(); if (mkfs) m->set_mkfs(mkfs); @@ -478,7 +478,7 @@ int Client::mount(int mkfs) // we got osdcluster! osdcluster->decode(reply->get_osd_cluster_state()); - dout(1) << "mounted" << endl; + dout(2) << "mounted" << endl; mounted = true; delete reply; @@ -492,14 +492,14 @@ int Client::unmount() assert(mounted); // caller is confused? - dout(1) << "unmounting" << endl; + dout(2) << "unmounting" << endl; Message *req = new MGenericMessage(MSG_CLIENT_UNMOUNT); client_lock.Unlock(); Message *reply = messenger->sendrecv(req, MSG_ADDR_MDS(0), MDS_PORT_SERVER); client_lock.Lock(); assert(reply); mounted = false; - dout(1) << "unmounted" << endl; + dout(2) << "unmounted" << endl; delete reply; diff --git a/ceph/mds/LogStream.cc b/ceph/mds/LogStream.cc index b72bacabd9f5..aafaeabed121 100644 --- a/ceph/mds/LogStream.cc +++ b/ceph/mds/LogStream.cc @@ -58,6 +58,10 @@ void LogStream::_append_2(off_t off) { dout(15) << "sync_pos now " << off << endl; sync_pos = off; + + // discard written bufferlist + delete writing_buffers[off]; + writing_buffers.erase(off); // wake up waiters map< off_t, list >::iterator it = waiting_for_sync.begin(); @@ -97,13 +101,17 @@ void LogStream::flush() assert(write_buf.length() == append_pos - flush_pos); + // tuck writing buffer away until write finishes + writing_buffers[flush_pos] = new bufferlist; + writing_buffers[flush_pos]->claim(write_buf); + + // write it mds->filer->write(log_ino, - write_buf.length(), flush_pos, - write_buf, + writing_buffers[flush_pos]->length(), flush_pos, + *writing_buffers[flush_pos], 0, new C_LS_Append(this, append_pos)); - - write_buf.clear(); + flush_pos = append_pos; } else { dout(15) << "flush flush_pos " << flush_pos << " == append_pos " << append_pos << ", nothing to do" << endl; diff --git a/ceph/mds/LogStream.h b/ceph/mds/LogStream.h index 6c9846d36242..df1abbf0c8b2 100644 --- a/ceph/mds/LogStream.h +++ b/ceph/mds/LogStream.h @@ -27,6 +27,9 @@ class LogStream { off_t append_pos; // where next event will be written bufferlist write_buf; // unwritten (between flush_pos and append_pos) + std::map< off_t, bufferlist* > writing_buffers; + + // reading off_t read_pos; // abs position in file //off_t read_buf_start; // where read buf begins diff --git a/ceph/msg/TCPMessenger.cc b/ceph/msg/TCPMessenger.cc index a89370880f4a..80616b78fd20 100644 --- a/ceph/msg/TCPMessenger.cc +++ b/ceph/msg/TCPMessenger.cc @@ -177,7 +177,7 @@ int tcpmessenger_init(int& argc, char**& argv) int tcpmessenger_shutdown() { - dout(1) << "tcpmessenger_shutdown closing all sockets etc" << endl; + dout(2) << "tcpmessenger_shutdown closing all sockets etc" << endl; // bleh for (int i=0; i diff --git a/ceph/tcpsyn.cc b/ceph/tcpsyn.cc index 9eb0fa9d65c1..7f287f9191a2 100644 --- a/ceph/tcpsyn.cc +++ b/ceph/tcpsyn.cc @@ -118,14 +118,16 @@ int main(int oargc, char **oargv) { } // create client + set clientlist; Client *client[NUMCLIENT]; SyntheticClient *syn[NUMCLIENT]; for (int i=0; i