diff options
author | Marvin Borner | 2019-11-24 23:34:32 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-24 23:34:32 +0100 |
commit | bb57b124d1bb385d41747f50be7dd4f3625539c1 (patch) | |
tree | fe461afad63df40571784565e8d435cba8c8e59c /src/kernel/fs/vfs.c | |
parent | f9c50b9ff23e9a3e8db5826fef7a6e7ebb8af21d (diff) |
Major coding style reformatting -> Kernighan & Ritchie
This project now (hopefully) uses the same style recommended by Kernighan and Ritchie and used in the Linux Kernel
Diffstat (limited to 'src/kernel/fs/vfs.c')
-rw-r--r-- | src/kernel/fs/vfs.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/kernel/fs/vfs.c b/src/kernel/fs/vfs.c index 5591a60..702851e 100644 --- a/src/kernel/fs/vfs.c +++ b/src/kernel/fs/vfs.c @@ -2,31 +2,36 @@ fs_node_t *fs_root = 0; -uint32_t read_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) { +uint32_t read_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) +{ if (node->read != 0) return node->read(node, offset, size, buffer); else return 0; } -uint32_t write_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) { +uint32_t write_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) +{ if (node->write != 0) return node->write(node, offset, size, buffer); else return 0; } -void open_fs(fs_node_t *node, uint8_t read, uint8_t write) { +void open_fs(fs_node_t *node, uint8_t read, uint8_t write) +{ if (node->open != 0) return node->open(node); } -void close_fs(fs_node_t *node) { +void close_fs(fs_node_t *node) +{ if (node->close != 0) return node->close(node); } -struct dirent *readdir_fs(fs_node_t *node, uint32_t index) { +struct dirent *readdir_fs(fs_node_t *node, uint32_t index) +{ if ((node->flags & 0x7) == FS_DIRECTORY && node->readdir != 0) return node->readdir(node, index); @@ -34,7 +39,8 @@ struct dirent *readdir_fs(fs_node_t *node, uint32_t index) { return 0; } -fs_node_t *finddir_fs(fs_node_t *node, char *name) { +fs_node_t *finddir_fs(fs_node_t *node, char *name) +{ if ((node->flags & 0x7) == FS_DIRECTORY && node->finddir != 0) return node->finddir(node, name); |