BTRFS: Added retrieve sector size for later use

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
hyche 2017-06-09 17:50:13 +07:00 committed by Adrien Destugues
parent d87124efad
commit 7e8e6c2ebb
3 changed files with 6 additions and 0 deletions

View File

@ -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];

View File

@ -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;

View File

@ -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