xfs: Style cleanup, no functional change
Change-Id: I698dbaa6f51c185eaaac2e0b058b1c6ce994218e Reviewed-on: https://review.haiku-os.org/c/haiku/+/10536 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
ead5f1bdfc
commit
9de308df97
@@ -839,7 +839,7 @@ TreeDirectory::Lookup(const char* name, size_t length, xfs_ino_t* ino)
|
||||
|
||||
|
||||
uint32
|
||||
LongBlock::ExpectedMagic(int8 WhichDirectory, Inode* inode)
|
||||
LongBlock::ExpectedMagic(int8 whichDirectory, Inode* inode)
|
||||
{
|
||||
if (inode->Version() == 3)
|
||||
return XFS_BMAP_CRC_MAGIC;
|
||||
|
||||
@@ -215,7 +215,7 @@ Inode::VerifyInode() const
|
||||
}
|
||||
}
|
||||
|
||||
if(fNode->di_size & (1ULL << 63)) {
|
||||
if ((fNode->di_size & (1ULL << 63)) != 0) {
|
||||
ERROR("Invalid EOF of inode");
|
||||
return false;
|
||||
}
|
||||
@@ -396,10 +396,8 @@ Inode::MaxRecordsPossibleInTreeRoot()
|
||||
size_t lengthOfDataFork;
|
||||
if (ForkOffset() != 0)
|
||||
lengthOfDataFork = ForkOffset() << 3;
|
||||
else if(ForkOffset() == 0) {
|
||||
lengthOfDataFork = GetVolume()->InodeSize()
|
||||
- CoreInodeSize();
|
||||
}
|
||||
else if (ForkOffset() == 0)
|
||||
lengthOfDataFork = GetVolume()->InodeSize() - CoreInodeSize();
|
||||
|
||||
lengthOfDataFork -= sizeof(BlockInDataFork);
|
||||
return lengthOfDataFork / (XFS_KEY_SIZE + XFS_PTR_SIZE);
|
||||
@@ -645,11 +643,10 @@ Inode::ReadAt(off_t pos, uint8* buffer, size_t* length)
|
||||
is not possible we will read file of remaining bytes.
|
||||
This meathod will change when we will add file cache for xfs.
|
||||
*/
|
||||
if(lengthLeftInFile >= 4096) {
|
||||
if (lengthLeftInFile >= 4096)
|
||||
*length = 4096;
|
||||
} else {
|
||||
else
|
||||
*length = lengthLeftInFile;
|
||||
}
|
||||
|
||||
// We could be almost at the end of the file
|
||||
if (lengthLeftInFile <= lengthLeftInBlock)
|
||||
|
||||
@@ -389,8 +389,7 @@ NodeDirectory::Lookup(const char* name, size_t length, xfs_ino_t* ino)
|
||||
|
||||
TRACE("rightMapOffset:(%" B_PRIu32 ")\n", rightMapOffset);
|
||||
|
||||
for(int i = fFirstLeafMapIndex; i < fInode->DataExtentsCount(); i++)
|
||||
{
|
||||
for (int i = fFirstLeafMapIndex; i < fInode->DataExtentsCount(); i++) {
|
||||
FillMapEntry(i, fLeafMap);
|
||||
fCurLeafMapNumber = 2;
|
||||
status = FillBuffer(LEAF, fLeafBuffer,
|
||||
|
||||
@@ -58,4 +58,5 @@ bool VerifyHeader(T* header, char* buffer, Inode* inode,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -60,7 +60,6 @@ Volume::Identify(int fd, XfsSuperBlock *superBlock)
|
||||
ERROR("Filesystem is corrupted");
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
superBlock->SwapEndian();
|
||||
|
||||
@@ -358,8 +358,7 @@ xfs_access(fs_volume *_volume, fs_vnode *_node, int accessMode)
|
||||
|
||||
|
||||
static status_t
|
||||
xfs_read_link(fs_volume *_volume, fs_vnode *_node, char *buffer,
|
||||
size_t *_bufferSize)
|
||||
xfs_read_link(fs_volume *_volume, fs_vnode *_node, char *buffer, size_t* _bufferSize)
|
||||
{
|
||||
TRACE("XFS_READ_SYMLINK\n");
|
||||
|
||||
@@ -387,8 +386,7 @@ xfs_unlink(fs_volume *_volume, fs_vnode *_directory, const char *name)
|
||||
|
||||
|
||||
static status_t
|
||||
xfs_create_dir(fs_volume *_volume, fs_vnode *_directory, const char *name,
|
||||
int mode)
|
||||
xfs_create_dir(fs_volume* _volume, fs_vnode* _directory, const char* name, int mode)
|
||||
{
|
||||
return B_NOT_SUPPORTED;
|
||||
}
|
||||
@@ -424,8 +422,8 @@ xfs_open_dir(fs_volume * /*_volume*/, fs_vnode *_node, void **_cookie)
|
||||
|
||||
|
||||
static status_t
|
||||
xfs_read_dir(fs_volume *_volume, fs_vnode *_node, void *_cookie,
|
||||
struct dirent *buffer, size_t bufferSize, uint32 *_num)
|
||||
xfs_read_dir(fs_volume *_volume, fs_vnode *_node, void *_cookie, struct dirent* buffer,
|
||||
size_t bufferSize, uint32* _num)
|
||||
{
|
||||
TRACE("XFS_READ_DIR\n");
|
||||
DirectoryIterator* iterator = (DirectoryIterator*)_cookie;
|
||||
|
||||
@@ -92,14 +92,12 @@ XfsSuperBlock::IsValid() const
|
||||
}
|
||||
|
||||
// Checking correct version of filesystem
|
||||
if(!(IsValidVersion())) {
|
||||
if (!(IsValidVersion()))
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((Version() & XFS_SB_VERSION_NUMBITS) == 4) {
|
||||
|
||||
if(sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD |
|
||||
XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD)) {
|
||||
if (sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD | XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD)) {
|
||||
ERROR("V4 Superblock has XFS_{P|G}QUOTA_{ENFD|CHKD} bits");
|
||||
return false;
|
||||
}
|
||||
@@ -107,9 +105,8 @@ XfsSuperBlock::IsValid() const
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!(IsValidFeatureMask())) {
|
||||
if (!(IsValidFeatureMask()))
|
||||
return false;
|
||||
}
|
||||
|
||||
// For V5
|
||||
if (XFS_MIN_CRC_BLOCKSIZE > sb_blocksize) {
|
||||
@@ -321,11 +318,10 @@ XfsSuperBlock::MagicNum() const
|
||||
bool
|
||||
XfsSuperBlock::UuidEquals(const uuid_t& u1)
|
||||
{
|
||||
if((sb_features_incompat & XFS_SB_FEAT_INCOMPAT_META_UUID) != 0) {
|
||||
if ((sb_features_incompat & XFS_SB_FEAT_INCOMPAT_META_UUID) != 0)
|
||||
return memcmp(&u1, &sb_meta_uuid, sizeof(uuid_t)) == 0;
|
||||
} else {
|
||||
else
|
||||
return memcmp(&u1, &sb_uuid, sizeof(uuid_t)) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user