aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/ext2.c
diff options
context:
space:
mode:
authorMarvin Borner2020-04-19 17:33:06 +0200
committerMarvin Borner2020-04-19 17:33:06 +0200
commit63a2e138f3f5f8d4fa731a06dc2b0e3ab4eab3bc (patch)
tree6607d5229881ce092e91550c1fa9d676ecdac393 /src/kernel/fs/ext2.c
parentdce9106bcb47ef37a4cf5a221340f4eb438aedfe (diff)
Applied tidy command...
Idk why I forgot it for several commits :D
Diffstat (limited to 'src/kernel/fs/ext2.c')
-rw-r--r--src/kernel/fs/ext2.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/kernel/fs/ext2.c b/src/kernel/fs/ext2.c
index bc17db6..41c2a3d 100644
--- a/src/kernel/fs/ext2.c
+++ b/src/kernel/fs/ext2.c
@@ -570,7 +570,9 @@ void set_disk_block_number(ext2_fs_t *ext2fs, inode_t *inode, uint32_t inode_idx
}
b = a - p;
if (b <= 0) {
- if(!alloc_inode_metadata_block(&(inode->blocks[EXT2_DIRECT_BLOCKS]), ext2fs, inode, inode_idx, NULL, 0));
+ if (!alloc_inode_metadata_block(&(inode->blocks[EXT2_DIRECT_BLOCKS]), ext2fs, inode,
+ inode_idx, NULL, 0))
+ ;
read_disk_block(ext2fs, inode->blocks[EXT2_DIRECT_BLOCKS], (void *)tmp);
((unsigned int *)tmp)[a] = disk_block;
write_disk_block(ext2fs, inode->blocks[EXT2_DIRECT_BLOCKS], (void *)tmp);
@@ -581,9 +583,13 @@ void set_disk_block_number(ext2_fs_t *ext2fs, inode_t *inode, uint32_t inode_idx
if (c <= 0) {
c = b / p;
d = b - c * p;
- if(!alloc_inode_metadata_block(&(inode->blocks[EXT2_DIRECT_BLOCKS + 1]), ext2fs, inode, inode_idx, NULL, 0));
+ if (!alloc_inode_metadata_block(&(inode->blocks[EXT2_DIRECT_BLOCKS + 1]), ext2fs,
+ inode, inode_idx, NULL, 0))
+ ;
read_disk_block(ext2fs, inode->blocks[EXT2_DIRECT_BLOCKS + 1], (void *)tmp);
- if(!alloc_inode_metadata_block(&(tmp[c]), ext2fs, inode, inode_idx, (void*)tmp, inode->blocks[EXT2_DIRECT_BLOCKS + 1]));
+ if (!alloc_inode_metadata_block(&(tmp[c]), ext2fs, inode, inode_idx, (void *)tmp,
+ inode->blocks[EXT2_DIRECT_BLOCKS + 1]))
+ ;
unsigned int temp = tmp[c];
read_disk_block(ext2fs, temp, (void *)tmp);
tmp[d] = disk_block;
@@ -595,12 +601,18 @@ void set_disk_block_number(ext2_fs_t *ext2fs, inode_t *inode, uint32_t inode_idx
e = c / (p * p);
f = (c - e * p * p) / p;
g = (c - e * p * p - f * p);
- if(!alloc_inode_metadata_block(&(inode->blocks[EXT2_DIRECT_BLOCKS + 2]), ext2fs, inode, inode_idx, NULL, 0));
+ if (!alloc_inode_metadata_block(&(inode->blocks[EXT2_DIRECT_BLOCKS + 2]), ext2fs,
+ inode, inode_idx, NULL, 0))
+ ;
read_disk_block(ext2fs, inode->blocks[EXT2_DIRECT_BLOCKS + 2], (void *)tmp);
- if(!alloc_inode_metadata_block(&(tmp[e]), ext2fs, inode, inode_idx, (void*)tmp, inode->blocks[EXT2_DIRECT_BLOCKS + 2]));
+ if (!alloc_inode_metadata_block(&(tmp[e]), ext2fs, inode, inode_idx, (void *)tmp,
+ inode->blocks[EXT2_DIRECT_BLOCKS + 2]))
+ ;
unsigned int temp = tmp[e];
read_disk_block(ext2fs, tmp[e], (void *)tmp);
- if(!alloc_inode_metadata_block(&(tmp[f]), ext2fs, inode, inode_idx, (void*)tmp, temp));
+ if (!alloc_inode_metadata_block(&(tmp[f]), ext2fs, inode, inode_idx, (void *)tmp,
+ temp))
+ ;
temp = tmp[f];
read_disk_block(ext2fs, tmp[f], (void *)tmp);
tmp[g] = disk_block;
@@ -784,4 +796,4 @@ void ext2_init(char *device_path, char *mountpoint)
inode_t *root_inode = kcalloc(sizeof(inode_t), 1);
read_inode_metadata(ext2fs, root_inode, ROOT_INODE_NUMBER);
vfs_mount(mountpoint, get_ext2_root(ext2fs, root_inode));
-}
+} \ No newline at end of file