diff --git a/src/add-ons/kernel/file_systems/btrfs/Volume.cpp b/src/add-ons/kernel/file_systems/btrfs/Volume.cpp index ed1bd624f1..71e148a687 100644 --- a/src/add-ons/kernel/file_systems/btrfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/btrfs/Volume.cpp @@ -266,7 +266,9 @@ Volume::Mount(const char* deviceName, uint32 flags) } fBlockSize = fSuperBlock.BlockSize(); + fSectorSize = fSuperBlock.SectorSize(); TRACE("block size %" B_PRIu32 "\n", fBlockSize); + TRACE("sector size %" B_PRIu32 "\n", fSectorSize); uint8* start = (uint8*)&fSuperBlock.system_chunk_array[0]; uint8* end = (uint8*)&fSuperBlock.system_chunk_array[2048]; diff --git a/src/add-ons/kernel/file_systems/btrfs/Volume.h b/src/add-ons/kernel/file_systems/btrfs/Volume.h index e5b371fafe..65610871b3 100644 --- a/src/add-ons/kernel/file_systems/btrfs/Volume.h +++ b/src/add-ons/kernel/file_systems/btrfs/Volume.h @@ -41,7 +41,9 @@ public: BTree* FSTree() const { return fFSTree; } BTree* RootTree() const { return fRootTree; } + uint32 SectorSize() const { return fSectorSize; } uint32 BlockSize() const { return fBlockSize; } + btrfs_super_block& SuperBlock() { return fSuperBlock; } status_t LoadSuperBlock(); @@ -62,6 +64,7 @@ private: char fName[32]; uint32 fFlags; + uint32 fSectorSize; uint32 fBlockSize; void* fBlockCache; diff --git a/src/add-ons/kernel/file_systems/btrfs/btrfs.h b/src/add-ons/kernel/file_systems/btrfs/btrfs.h index c0cf017660..2afe5a9860 100644 --- a/src/add-ons/kernel/file_systems/btrfs/btrfs.h +++ b/src/add-ons/kernel/file_systems/btrfs/btrfs.h @@ -178,6 +178,7 @@ struct btrfs_super_block { // implemented in Volume.cpp uint64 TotalSize() const { return B_LENDIAN_TO_HOST_INT64(total_size); } uint32 BlockSize() const { return B_LENDIAN_TO_HOST_INT32(node_size); } + uint32 SectorSize() const { return B_LENDIAN_TO_HOST_INT32(sector_size); } uint64 RootDirObjectID() const { return B_LENDIAN_TO_HOST_INT64(root_dir_object_id); } uint64 Generation() const