]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 28 Jun 2005 04:33:00 +0000 (04:33 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 28 Jun 2005 04:33:00 +0000 (04:33 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@350 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/Makefile
ceph/client/Client.cc
ceph/mds/LogStream.cc
ceph/mds/LogStream.h
ceph/msg/TCPMessenger.cc
ceph/osd/OBFSStore.cc
ceph/tcpsyn.cc

index d88159fd3ef8105f2a39a273f6ee8af1b237c0dc..5931de444ac8c01f827942a030b07658db52189b 100644 (file)
@@ -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 $@
index 44cd13df00d71a689d336cece6eb88c8f7dcbcd6..b9dccc094ab660ca76a956ea260a9b8e3bdac088 100644 (file)
@@ -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;
 
index b72bacabd9f53aae320be5fa411ca60703de6e2a..aafaeabed12178a0e78e0c9bb7a8d2bb99f6a5d7 100644 (file)
@@ -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<Context*> >::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;
index 6c9846d362429a1e0ca472d8559febad4870e43d..df1abbf0c8b249654068c550d6756a2b829445bb 100644 (file)
@@ -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
index a89370880f4a78ab860d59edbe68c06a42244265..80616b78fd20cf98246bbb164ef7c1a057900ed8 100644 (file)
@@ -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<mpi_world; i++) {
index 8f8d285d9c5efbf292b327eb1b5c395413361703..f88dd9832acde15c10c6adb391e44ae03b202d7d 100644 (file)
@@ -2,8 +2,9 @@
 #include "OBFSStore.h"
 
 extern "C" {
-#include "../include/uofs.h"
+#include "../../uofs/uofs.h"
 }
+
 #include "include/types.h"
 
 #include <unistd.h>
index 9eb0fa9d65c1c9d6998c902f51c0c7a8269e50ae..7f287f9191a275b5222c34d5095df13952bcb855 100644 (file)
@@ -118,14 +118,16 @@ int main(int oargc, char **oargv) {
   }
   
   // create client
+  set<int> clientlist;
   Client *client[NUMCLIENT];
   SyntheticClient *syn[NUMCLIENT];
   for (int i=0; i<NUMCLIENT; i++) {
        if (myrank != MPI_DEST_TO_RANK(MSG_ADDR_CLIENT(i),world)) continue;
-       cerr << "client" << i << " on rank " << myrank << " " << hostname << "." << pid << endl;
+       clientlist.insert(i);
        client[i] = new Client(mdc, i, new TCPMessenger(MSG_ADDR_CLIENT(i)) );
        start++;
   }
+  cerr << "clients " << clientlist << " on rank " << myrank << " " << hostname << "." << pid << endl;
 
 
   // start message loop