btrfs: Fix various coding style issues
- Fix pointer/reference style in btrfs_disk_system.cpp
- Add missing blank line between class definitions in Inode.h
- Remove trailing whitespace in AttributeIterator.h
- Add missing space before inline comment in BTree.cpp
- Add missing space before '{' in ExtentAllocator.cpp
- Fix C-style cast pointer style in Volume.cpp
No functional changes.
Hashtags: gsoc2026
Change-Id: I7922a4736c072691163c05288f142cdaff1dcf9c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10469
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
4ce9cacce2
commit
0ed6a7bdeb
@@ -16,7 +16,7 @@ public:
|
|||||||
//! Constructs an AttributeIterator object for Inode object *inode
|
//! Constructs an AttributeIterator object for Inode object *inode
|
||||||
AttributeIterator(Inode* inode);
|
AttributeIterator(Inode* inode);
|
||||||
~AttributeIterator();
|
~AttributeIterator();
|
||||||
//! Check if fIterator pointer is valid
|
//! Check if fIterator pointer is valid
|
||||||
status_t InitCheck();
|
status_t InitCheck();
|
||||||
|
|
||||||
/*! Copy details of next Attribute into *name and *_nameLength
|
/*! Copy details of next Attribute into *name and *_nameLength
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ status_t
|
|||||||
BTree::Node::MoveEntries(uint32 start, uint32 end, int length) const
|
BTree::Node::MoveEntries(uint32 start, uint32 end, int length) const
|
||||||
{
|
{
|
||||||
status_t status = _SpaceCheck(length);
|
status_t status = _SpaceCheck(length);
|
||||||
if (status != B_OK || length == 0/*B_OK*/)
|
if (status != B_OK || length == 0 /*B_OK*/)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
int entrySize = sizeof(btrfs_entry);
|
int entrySize = sizeof(btrfs_entry);
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ CachedExtentTree::_AddFreeExtent(CachedExtent* node)
|
|||||||
found->offset += diff + node->length;
|
found->offset += diff + node->length;
|
||||||
found->length -= diff + node->length;
|
found->length -= diff + node->length;
|
||||||
// diff < 0 couldn't happen because of the Compare function
|
// diff < 0 couldn't happen because of the Compare function
|
||||||
if (diff > 0){
|
if (diff > 0) {
|
||||||
CachedExtent* left = CachedExtent::Create(node->offset - diff,
|
CachedExtent* left = CachedExtent::Create(node->offset - diff,
|
||||||
diff, found->flags);
|
diff, found->flags);
|
||||||
_AddAllocatedExtent(left);
|
_AddAllocatedExtent(left);
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ private:
|
|||||||
btrfs_inode fNode;
|
btrfs_inode fNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*!The Vnode class provides a convenience layer upon get_vnode(), so that
|
/*!The Vnode class provides a convenience layer upon get_vnode(), so that
|
||||||
* you don't have to call put_vnode() anymore, which may make code more
|
* you don't have to call put_vnode() anymore, which may make code more
|
||||||
* readable in some cases
|
* readable in some cases
|
||||||
|
|||||||
@@ -521,7 +521,7 @@ status_t
|
|||||||
Volume::WriteSuperBlock()
|
Volume::WriteSuperBlock()
|
||||||
{
|
{
|
||||||
uint32 checksum = calculate_crc((uint32)~1,
|
uint32 checksum = calculate_crc((uint32)~1,
|
||||||
(uint8 *)&fSuperBlock + sizeof(fSuperBlock.checksum),
|
(uint8*)&fSuperBlock + sizeof(fSuperBlock.checksum),
|
||||||
sizeof(fSuperBlock) - sizeof(fSuperBlock.checksum));
|
sizeof(fSuperBlock) - sizeof(fSuperBlock.checksum));
|
||||||
|
|
||||||
fSuperBlock.checksum[0] = (checksum >> 0) & 0xFF;
|
fSuperBlock.checksum[0] = (checksum >> 0) & 0xFF;
|
||||||
|
|||||||
@@ -17,20 +17,20 @@ parse_initialize_parameters(const char* parameterString,
|
|||||||
{
|
{
|
||||||
parameters.verbose = false;
|
parameters.verbose = false;
|
||||||
|
|
||||||
void *handle = parse_driver_settings_string(parameterString);
|
void* handle = parse_driver_settings_string(parameterString);
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
if (get_driver_boolean_parameter(handle, "verbose", false, true))
|
if (get_driver_boolean_parameter(handle, "verbose", false, true))
|
||||||
parameters.verbose = true;
|
parameters.verbose = true;
|
||||||
|
|
||||||
const char *ss_string = get_driver_parameter(handle, "sector_size",
|
const char* ss_string = get_driver_parameter(handle, "sector_size",
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
uint32 sectorSize = B_PAGE_SIZE;
|
uint32 sectorSize = B_PAGE_SIZE;
|
||||||
if (ss_string != NULL)
|
if (ss_string != NULL)
|
||||||
sectorSize = strtoul(ss_string, NULL, 0);
|
sectorSize = strtoul(ss_string, NULL, 0);
|
||||||
|
|
||||||
const char *bs_string = get_driver_parameter(handle, "block_size",
|
const char* bs_string = get_driver_parameter(handle, "block_size",
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
uint32 blockSize = max_c(16384, B_PAGE_SIZE);
|
uint32 blockSize = max_c(16384, B_PAGE_SIZE);
|
||||||
if (bs_string != NULL)
|
if (bs_string != NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user