xfs: coding style fixed, no functional changes
Change-Id: I56a1220abc330ef853cee4bdb9fa9c1b712784a4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3143 Reviewed-by: Adrien Destugues <[email protected]> Reviewed-by: Rene Gollent <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
@@ -98,8 +98,8 @@ size_t
|
|||||||
TreeDirectory::GetPtrOffsetIntoRoot(int pos)
|
TreeDirectory::GetPtrOffsetIntoRoot(int pos)
|
||||||
{
|
{
|
||||||
size_t maxRecords = MaxRecordsPossibleRoot();
|
size_t maxRecords = MaxRecordsPossibleRoot();
|
||||||
return (sizeof(BlockInDataFork)
|
return sizeof(BlockInDataFork) + maxRecords * KeySize()
|
||||||
+ maxRecords * KeySize() + (pos - 1) * PtrSize());
|
+ (pos - 1) * PtrSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -814,8 +814,8 @@ TreeDirectory::Lookup(const char* name, size_t length, xfs_ino_t* ino)
|
|||||||
|
|
||||||
FillBuffer(fSingleDirBlock,
|
FillBuffer(fSingleDirBlock,
|
||||||
nextLeaf - targetMap->br_startoff, targetMap);
|
nextLeaf - targetMap->br_startoff, targetMap);
|
||||||
|
|
||||||
fOffsetOfSingleDirBlock = nextLeaf;
|
fOffsetOfSingleDirBlock = nextLeaf;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ NodeDirectory::IsNodeType()
|
|||||||
FillMapEntry(fInode->DataExtentsCount() - 3, fLeafMap);
|
FillMapEntry(fInode->DataExtentsCount() - 3, fLeafMap);
|
||||||
fCurLeafMapNumber = 1;
|
fCurLeafMapNumber = 1;
|
||||||
}
|
}
|
||||||
return fLeafMap->br_startoff == LEAF_STARTOFFSET(fInode->GetVolume()->BlockLog());
|
return fLeafMap->br_startoff
|
||||||
|
== LEAF_STARTOFFSET(fInode->GetVolume()->BlockLog());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -101,8 +102,8 @@ NodeDirectory::FillBuffer(int type, char* blockBuffer, int howManyBlocksFurthur)
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
xfs_daddr_t readPos =
|
xfs_daddr_t readPos = fInode->FileSystemBlockToAddr(map->br_startblock
|
||||||
fInode->FileSystemBlockToAddr(map->br_startblock + howManyBlocksFurthur);
|
+ howManyBlocksFurthur);
|
||||||
|
|
||||||
if (read_pos(fInode->GetVolume()->Device(), readPos, blockBuffer, len)
|
if (read_pos(fInode->GetVolume()->Device(), readPos, blockBuffer, len)
|
||||||
!= len) {
|
!= len) {
|
||||||
@@ -165,7 +166,7 @@ NodeDirectory::EntrySize(int len) const
|
|||||||
if (fInode->HasFileTypeField())
|
if (fInode->HasFileTypeField())
|
||||||
entrySize += sizeof(uint8);
|
entrySize += sizeof(uint8);
|
||||||
|
|
||||||
return (entrySize + 7) & -8;
|
return ROUNDUP(entrySize, 8);
|
||||||
// rounding off to closest multiple of 8
|
// rounding off to closest multiple of 8
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,9 +203,11 @@ NodeDirectory::GetNext(char* name, size_t* length, xfs_ino_t* ino)
|
|||||||
// This could be an unused entry so we should check
|
// This could be an unused entry so we should check
|
||||||
|
|
||||||
uint32 blockNoFromAddress = BLOCKNO_FROM_ADDRESS(fOffset, volume);
|
uint32 blockNoFromAddress = BLOCKNO_FROM_ADDRESS(fOffset, volume);
|
||||||
if (fOffset != 0 && blockNoFromAddress == fCurBlockNumber)
|
if (fOffset != 0 && blockNoFromAddress == fCurBlockNumber) {
|
||||||
entry = (void*)(fDataBuffer + BLOCKOFFSET_FROM_ADDRESS(fOffset, fInode));
|
entry = (void*)(fDataBuffer
|
||||||
|
+ BLOCKOFFSET_FROM_ADDRESS(fOffset, fInode));
|
||||||
// This gets us a little faster to the next entry
|
// This gets us a little faster to the next entry
|
||||||
|
}
|
||||||
|
|
||||||
uint32 curDirectorySize = fInode->Size();
|
uint32 curDirectorySize = fInode->Size();
|
||||||
|
|
||||||
@@ -306,7 +309,8 @@ NodeDirectory::Lookup(const char* name, size_t length, xfs_ino_t* ino)
|
|||||||
|
|
||||||
FillMapEntry(fInode->DataExtentsCount() - 2, fLeafMap);
|
FillMapEntry(fInode->DataExtentsCount() - 2, fLeafMap);
|
||||||
fCurLeafMapNumber = 2;
|
fCurLeafMapNumber = 2;
|
||||||
status = FillBuffer(LEAF, fLeafBuffer, rightMapOffset - fLeafMap->br_startoff);
|
status = FillBuffer(LEAF, fLeafBuffer,
|
||||||
|
rightMapOffset - fLeafMap->br_startoff);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
fCurLeafBufferNumber = 2;
|
fCurLeafBufferNumber = 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user