]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: writefull directory objects
authorSage Weil <sage@newdream.net>
Wed, 20 Aug 2008 16:23:24 +0000 (09:23 -0700)
committerSage Weil <sage@newdream.net>
Wed, 20 Aug 2008 16:23:24 +0000 (09:23 -0700)
src/mds/CDir.cc

index 09ec69a4f8c4fcdd51a636f73eb7e1a675c316b3..5a48a33f22e87879fcbe0b8417f7aa4e4cd5f6a3 100644 (file)
@@ -1262,7 +1262,7 @@ void CDir::_fetched(bufferlist &bl)
       }
     }
   }
-  //assert(off == len);  FIXME  no, directories may shrink.  add this back in when we properly truncate objects on write.
+  assert(p.end());
 
   //cache->mds->logger->inc("newin", num_new_inodes_loaded);
   //hack_num_accessed = 0;
@@ -1470,13 +1470,12 @@ void CDir::_commit(version_t want)
 
   // write it.
   SnapContext snapc;
-  cache->mds->objecter->write( get_ondisk_object(),
-                              0, finalbl.length(),
-                              cache->mds->objecter->osdmap->file_to_object_layout( get_ondisk_object(),
-                                                                                   g_default_mds_dir_layout ),
-                              snapc,
-                              finalbl, 0,
-                              NULL, new C_Dir_Committed(this, get_version()) );
+  cache->mds->objecter->write_full( get_ondisk_object(),
+                                   cache->mds->objecter->osdmap->file_to_object_layout( get_ondisk_object(),
+                                                                                        g_default_mds_dir_layout ),
+                                   snapc,
+                                   finalbl, 0,
+                                   NULL, new C_Dir_Committed(this, get_version()) );
 }