]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
misc cleanups
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 11 Aug 2007 23:15:01 +0000 (23:15 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 11 Aug 2007 23:15:01 +0000 (23:15 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1625 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/mds/TODO
branches/sage/mds/client/Client.cc
branches/sage/mds/config.cc
branches/sage/mds/config.h
branches/sage/mds/ebofs/Ebofs.cc
branches/sage/mds/fakefuse.cc
branches/sage/mds/mds/Capability.h
branches/sage/mds/messages/MOSDOp.h
branches/sage/mds/messages/MOSDOpReply.h
branches/sage/mds/osd/FakeStore.cc

index b667ad5cd731bf42dce709ed702204b01667fc42..e054faa939406f89a3b63d14dd1b4590d15d5d85 100644 (file)
@@ -181,6 +181,7 @@ simplemessenger
 - exponential backoff on monitor resend attempts (actually, this should go outside the messenger!)
 
 objectcacher
+- merge clean bh's
 - ocacher caps transitions vs locks
 - test read locks
 
index 483051ff588b72247cdd440b4286fba455e6e9dc..792aae64350619ad7718004fd661d095c14e7058 100644 (file)
@@ -2701,6 +2701,10 @@ void Client::unlock_fh_pos(Fh *f)
 }
 
 
+
+//char *hackbuf = 0;
+
+
 // blocking osd interface
 
 int Client::read(int fd, char *buf, off_t size, off_t offset) 
@@ -2766,6 +2770,19 @@ int Client::_read(Fh *f, off_t offset, off_t size, bufferlist *bl)
   if (g_conf.client_oc) {
     // object cache ON
     rvalue = r = in->fc.read(offset, size, *bl, client_lock);  // may block.
+
+    /*
+    if (in->inode.ino == 0x10000000075 && hackbuf) {
+      int s = MIN(size, bl->length());
+      char *v = bl->c_str();
+      for (int a=0; a<s; a++) 
+       if (v[a] != hackbuf[offset+a]) 
+         dout(1) << "** hackbuf differs from read value at offset " << a 
+                 << " hackbuf[a] = " << (int)hackbuf[a] << ", read got " << (int)v[a]
+                 << endl;
+    }
+    */
+
   } else {
     // object cache OFF -- legacy inconsistent way.
 
@@ -2854,6 +2871,7 @@ int Client::write(int fd, const char *buf, off_t size, off_t offset)
   return r;
 }
 
+
 int Client::_write(Fh *f, off_t offset, off_t size, const char *buf)
 {
   //dout(7) << "write fh " << fh << " size " << size << " offset " << offset << endl;
@@ -2882,9 +2900,23 @@ int Client::_write(Fh *f, off_t offset, off_t size, const char *buf)
   if (g_conf.client_oc) { // buffer cache ON?
     assert(objectcacher);
 
+    /*
+    if (f->inode->inode.ino == 0x10000000075) {
+      if (!hackbuf) {
+       dout(7) << "alloc and zero new hackbuf" << endl;
+       hackbuf = new char[16384];
+       memset(hackbuf, 0, 16384);
+      }
+      dout(7) << "hackbuf copying " << offset << "~" << size << " first is " << (int)buf[0] << endl;
+      memcpy(hackbuf+offset, buf, size);
+      for (int a=0; a<size; a++) 
+       dout(10) << "hackbuf[" << (a+offset) << " = " << (int)hackbuf[a+offset] << " = " << (int)buf[a] << endl;
+    }
+    */
+
     // write (this may block!)
     in->fc.write(offset, size, blist, client_lock);
-    
+
   } else {
     // legacy, inconsistent synchronous write.
     dout(7) << "synchronous write" << endl;
index 82254c07afc1837b2e7c1b675cb152d55b3b8741..d8a789ea001bcb8393c75077565925f2ae2a3e41 100644 (file)
@@ -253,7 +253,7 @@ md_config_t g_conf = {
   osd_pad_pg_log: false,
   
   // --- fakestore ---
-  fakestore_fake_sync: 2,    // 2 seconds
+  fakestore_fake_sync: .5,    // seconds
   fakestore_fsync: false,//true,
   fakestore_writesync: false,
   fakestore_syncthreads: 4,
index ad907a1affa64912c36458637fe9e69b804637f5..9076092aba7399ebf6c11de3fe4f49c61bc787f6 100644 (file)
@@ -250,7 +250,7 @@ struct md_config_t {
   int   osd_max_pull;
   bool  osd_pad_pg_log;
 
-  int   fakestore_fake_sync;
+  double   fakestore_fake_sync;
   bool  fakestore_fsync;
   bool  fakestore_writesync;
   int   fakestore_syncthreads;   // such crap
index 21070781c19765c422beee44b638f84df18f5269..9b2259a5ee6985033c806e82e441be999d422e66 100644 (file)
@@ -1558,9 +1558,12 @@ void Ebofs::apply_write(Onode *on, off_t off, size_t len, const bufferlist& bl)
   if (bl.length() == 0) {
     zleft += len;
     left = 0;
+  } else {
+    assert(bl.length() == len);
   }
   if (zleft)
-    dout(10) << "apply_write zeroing first " << zleft << " bytes of " << *on << endl;
+    dout(10) << "apply_write zeroing " << zleft << " bytes before " << off << "~" << len 
+             << " in " << *on << endl;
 
   block_t blast = (len+off-1) / EBOFS_BLOCK_SIZE;
   block_t blen = blast-bstart+1;
@@ -1648,7 +1651,7 @@ void Ebofs::apply_write(Onode *on, off_t off, size_t len, const bufferlist& bl)
           bufferlist zb;
           zb.push_back(zp);
           bh->add_partial(off_in_bh, zb);
-           zleft -= z;
+         zleft -= z;
           opos += z;
         }
 
index d5c33c1cc11877496bb0ecdabf5ea93a6336e7a9..663a16b84d5c6f7bf51ea4c96a3d669111b71d36 100644 (file)
@@ -129,19 +129,19 @@ int main(int argc, char **argv) {
 
     // start up fuse
     // use my argc, argv (make sure you pass a mount point!)
-    cout << "starting fuse on pid " << getpid() << endl;
     client[i]->mount();
 
     char *oldcwd = get_current_dir_name();  // note previous wd
+    cout << "starting fuse on pid " << getpid() << endl;
     if (g_conf.fuse_ll)
       ceph_fuse_ll_main(client[i], argc, argv);
     else
       ceph_fuse_main(client[i], argc, argv);
+    cout << "fuse finished on pid " << getpid() << endl;
     ::chdir(oldcwd);                        // return to previous wd
     free(oldcwd);
 
     client[i]->unmount();
-    cout << "fuse finished on pid " << getpid() << endl;
     client[i]->shutdown();
   }
   
index eab6aa84b08bc81f1b336448439ccbce1e0efcf0..2c2241870650a6aa1bbece3e4c219df319363458 100644 (file)
@@ -76,7 +76,6 @@ public:
     last_sent(s),
     last_recv(s),
     suppress(false) { 
-    //cap_history[last_sent] = 0;
   }
   Capability(Export& other) : 
     wanted_caps(other.wanted),
index 43652dc5b9aedb1b5186e03bbff4c06d2e7be924..9dce4bdd00b27ce0f6ac526394afa980496cef67 100644 (file)
@@ -242,6 +242,7 @@ private:
     out << "osd_op(" << st.reqid
        << " " << get_opname(st.op)
        << " " << st.oid;
+    if (st.length) out << " " << st.offset << "~" << st.length;
     if (st.retry_attempt) out << " RETRY";
     out << ")";
   }
index e23210b7e902ab6b24a9f676ef5e95602d787b0b..bfe1674c07d3c9b5a86b227e2cdb78bb3a563569 100644 (file)
@@ -139,6 +139,7 @@ public:
     out << "osd_op_reply(" << st.reqid
        << " " << MOSDOp::get_opname(st.op)
        << " " << st.oid;
+    if (st.length) out << " " << st.offset << "~" << st.length;
     if (st.commit)
       out << " commit";
     else
index c945357c11586a9d1e5508027730c33abf885957..683c24634defd7381b8db58d7e381bb2e47777a0 100644 (file)
@@ -392,7 +392,7 @@ void FakeStore::sync()
 
 void FakeStore::sync(Context *onsafe)
 {
-  if (g_conf.fakestore_fake_sync) {
+  if (g_conf.fakestore_fake_sync > 0.0) {
     g_timer.add_event_after((float)g_conf.fakestore_fake_sync,
                             new C_FakeSync(onsafe, &unsync, &synclock, &synccond));