[haiku-commits] r36102 - haiku/trunk/src/add-ons/kernel/file_systems/reiserfs

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 10 Apr 2010 14:02:02 +0200 (CEST)

Author: bonefish
Date: 2010-04-10 14:02:02 +0200 (Sat, 10 Apr 2010)
New Revision: 36102
Changeset: http://dev.haiku-os.org/changeset/36102/haiku

Modified:
   haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp
Log:
Patch by Sean Bartell: Added support for old ReiserFS 3.5 super block location.


Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp 
2010-04-10 05:01:10 UTC (rev 36101)
+++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp 
2010-04-10 12:02:02 UTC (rev 36102)
@@ -32,9 +32,10 @@
        \class DirEntry
        \brief Represents the on-disk structure for super block of the FS.
 
-       There exist two versions of the structure and this class can deal with
-       both of them. The Init() methods tries to find and read the super block
-       from disk.
+       There exist two versions of the structure and this class can deal with 
both
+       of them. This class can also handle a very old layout that puts the 
super
+       block in a different location. The Init() methods tries to find and read
+       the super block from disk.
 */
 
 // read_super_block
@@ -95,14 +96,18 @@
 status_t
 SuperBlock::Init(int device, off_t offset)
 {
-       // Not sure, if I understand the weird versioning.
        status_t error = B_OK;
-       // try old version
+       // try old version and old layout
        if (read_super_block(device, REISERFS_OLD_DISK_OFFSET_IN_BYTES + offset,
                                                 REISERFS_SUPER_MAGIC_STRING, 
&fOldData) == B_OK) {
+PRINT(("SuperBlock: ReiserFS 3.5 (old layout)\n"));
+               fFormatVersion = REISERFS_3_5;
+       // try old version and new layout
+       } else if (read_super_block(device, REISERFS_DISK_OFFSET_IN_BYTES + 
offset,
+                       REISERFS_SUPER_MAGIC_STRING, &fOldData) == B_OK) {
 PRINT(("SuperBlock: ReiserFS 3.5\n"));
                fFormatVersion = REISERFS_3_5;
-       // try new version
+       // try new version and new layout
        } else if (read_super_block(device, REISERFS_DISK_OFFSET_IN_BYTES + 
offset,
                        REISER2FS_SUPER_MAGIC_STRING, &fOldData) == B_OK) {
 PRINT(("SuperBlock: ReiserFS 3.6\n"));


Other related posts:

  • » [haiku-commits] r36102 - haiku/trunk/src/add-ons/kernel/file_systems/reiserfs - ingo_weinhold