BTRFS: Added logical address (root) for BTree
This commit is contained in:
parent
7698541e6b
commit
370ee09fe5
@ -279,7 +279,9 @@ BTree::SetRoot(off_t logical, fsblock_t* block)
|
|||||||
{
|
{
|
||||||
if (block != NULL) {
|
if (block != NULL) {
|
||||||
fRootBlock = *block;
|
fRootBlock = *block;
|
||||||
|
//TODO: mapping physical block -> logical address
|
||||||
} else {
|
} else {
|
||||||
|
fLogicalRoot = logical;
|
||||||
if (fVolume->FindBlock(logical, fRootBlock) != B_OK) {
|
if (fVolume->FindBlock(logical, fRootBlock) != B_OK) {
|
||||||
ERROR("Find() unmapped block %" B_PRId64 "\n", fRootBlock);
|
ERROR("Find() unmapped block %" B_PRId64 "\n", fRootBlock);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
@ -57,8 +57,8 @@ public:
|
|||||||
size_t* size = NULL);
|
size_t* size = NULL);
|
||||||
|
|
||||||
status_t SetRoot(off_t logical, fsblock_t* block);
|
status_t SetRoot(off_t logical, fsblock_t* block);
|
||||||
|
|
||||||
fsblock_t RootBlock() const { return fRootBlock; }
|
fsblock_t RootBlock() const { return fRootBlock; }
|
||||||
|
off_t LogicalRoot() const { return fLogicalRoot; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BTree(const BTree& other);
|
BTree(const BTree& other);
|
||||||
@ -73,6 +73,7 @@ private:
|
|||||||
friend class TreeIterator;
|
friend class TreeIterator;
|
||||||
|
|
||||||
fsblock_t fRootBlock;
|
fsblock_t fRootBlock;
|
||||||
|
off_t fLogicalRoot;
|
||||||
Volume* fVolume;
|
Volume* fVolume;
|
||||||
mutex fIteratorLock;
|
mutex fIteratorLock;
|
||||||
SinglyLinkedList<TreeIterator> fIterators;
|
SinglyLinkedList<TreeIterator> fIterators;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user