@@ -888,7 +888,7 @@ int JournalTool::recover_dentries(
888888 }
889889
890890 if ((other_pool || write_dentry) && !dry_run) {
891- dout (4 ) << " writing I dentry " << key << " into frag "
891+ dout (4 ) << " writing i dentry " << key << " into frag "
892892 << frag_oid.name << dendl;
893893 dout (20 ) << " dnfirst = " << fb.dnfirst << dendl;
894894 if (!fb.alternate_name .empty ()) {
@@ -899,11 +899,14 @@ int JournalTool::recover_dentries(
899899 dout (20 ) << " alternate_name = b64:" << encoded << dendl;
900900 }
901901
902- // Compose: Dentry format is dnfirst, [I|L ], InodeStore(bare=true)
902+ // Compose: Dentry format is dnfirst, [i|l ], InodeStore
903903 bufferlist dentry_bl;
904904 encode (fb.dnfirst , dentry_bl);
905- encode (' I' , dentry_bl);
906- encode_fullbit_as_inode (fb, true , &dentry_bl);
905+ encode (' i' , dentry_bl);
906+ ENCODE_START (2 , 1 , dentry_bl);
907+ encode (fb.alternate_name , dentry_bl);
908+ encode_fullbit_as_inode (fb, &dentry_bl);
909+ ENCODE_FINISH (dentry_bl);
907910
908911 // Record for writing to RADOS
909912 write_vals[key] = dentry_bl;
@@ -958,12 +961,15 @@ int JournalTool::recover_dentries(
958961 dout (4 ) << " writing L dentry " << key << " into frag "
959962 << frag_oid.name << dendl;
960963
961- // Compose: Dentry format is dnfirst, [I|L], InodeStore(bare=true)
964+ // Compose: Dentry format is dnfirst, [I|L], ino, d_type, alternate_name
962965 bufferlist dentry_bl;
963966 encode (rb.dnfirst , dentry_bl);
964- encode (' L' , dentry_bl);
967+ encode (' l' , dentry_bl);
968+ ENCODE_START (2 , 1 , dentry_bl);
965969 encode (rb.ino , dentry_bl);
966970 encode (rb.d_type , dentry_bl);
971+ encode (rb.alternate_name , dentry_bl);
972+ ENCODE_FINISH (dentry_bl);
967973
968974 // Record for writing to RADOS
969975 write_vals[key] = dentry_bl;
@@ -1082,10 +1088,10 @@ int JournalTool::recover_dentries(
10821088 dout (4 ) << " writing root ino " << root_oid.name
10831089 << " version " << fb.inode ->version << dendl;
10841090
1085- // Compose: root ino format is magic,InodeStore(bare=false)
1091+ // Compose: root ino format is magic,InodeStore
10861092 bufferlist new_root_ino_bl;
10871093 encode (std::string (CEPH_FS_ONDISK_MAGIC), new_root_ino_bl);
1088- encode_fullbit_as_inode (fb, false , &new_root_ino_bl);
1094+ encode_fullbit_as_inode (fb, &new_root_ino_bl);
10891095
10901096 // Write to RADOS
10911097 r = output.write_full (root_oid.name , new_root_ino_bl);
@@ -1195,7 +1201,6 @@ int JournalTool::erase_region(JournalScanner const &js, uint64_t const pos, uint
11951201 */
11961202void JournalTool::encode_fullbit_as_inode (
11971203 const EMetaBlob::fullbit &fb,
1198- const bool bare,
11991204 bufferlist *out_bl)
12001205{
12011206 ceph_assert (out_bl != NULL );
@@ -1210,11 +1215,7 @@ void JournalTool::encode_fullbit_as_inode(
12101215 new_inode.old_inodes = fb.old_inodes ;
12111216
12121217 // Serialize InodeStore
1213- if (bare) {
1214- new_inode.encode_bare (*out_bl, CEPH_FEATURES_SUPPORTED_DEFAULT);
1215- } else {
1216- new_inode.encode (*out_bl, CEPH_FEATURES_SUPPORTED_DEFAULT);
1217- }
1218+ new_inode.encode (*out_bl, CEPH_FEATURES_SUPPORTED_DEFAULT);
12181219}
12191220
12201221/* *
0 commit comments