BTRFS: Implement GetNewBlock() function that will find the logical address for allocating and convert it to physical block.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
This commit is contained in:
parent
c1320b3a33
commit
4368661f03
|
@ -534,6 +534,20 @@ Volume::FindBlock(off_t logical, off_t& physical)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Wrapper function for allocating new block
|
||||||
|
*/
|
||||||
|
status_t
|
||||||
|
Volume::GetNewBlock(uint64& logical, fsblock_t& physical, uint64 start,
|
||||||
|
uint64 flags)
|
||||||
|
{
|
||||||
|
status_t status = fExtentAllocator->AllocateTreeBlock(logical, start, flags);
|
||||||
|
if (status != B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
return FindBlock(logical, physical);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - Disk scanning and initialization
|
// #pragma mark - Disk scanning and initialization
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,9 @@ public:
|
||||||
|
|
||||||
status_t FindBlock(off_t logical, fsblock_t& physical);
|
status_t FindBlock(off_t logical, fsblock_t& physical);
|
||||||
status_t FindBlock(off_t logical, off_t& physical);
|
status_t FindBlock(off_t logical, off_t& physical);
|
||||||
|
status_t GetNewBlock(uint64& logical, fsblock_t& physical,
|
||||||
|
uint64 start = (uint64)-1,
|
||||||
|
uint64 flags = BTRFS_BLOCKGROUP_FLAG_METADATA);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutex fLock;
|
mutex fLock;
|
||||||
|
|
Loading…
Reference in New Issue