Ext
 All Files Functions
methods.h
Go to the documentation of this file.
1 
7 #ifndef EXT_FILESYSTEM_CORE_METHODS_H_
8 #define EXT_FILESYSTEM_CORE_METHODS_H_
9 #include <string.h>
10 #include <stdio.h>
11 #include "superblock.h"
12 #include "block.h"
13 #include "inode.h"
14 
25 uint16_t create_dir_helper(int fd,
26  const struct superblock* superblock,
27  uint16_t parent_node_id,
28  bool is_root);
29 
38 uint16_t create_file_helper(int fd,
39  const struct superblock* superblock,
40  uint16_t parent_node_id);
41 
49 uint16_t get_inode_id_of_dir(int fd,
50  const char* path,
51  const struct superblock* superblock);
52 
61 bool is_dir_exist(int fd,
62  struct inode* inode,
63  const char* dirname,
64  const struct superblock* superblock);
65 
74 uint16_t get_file_inode_id(int fd,
75  struct inode* inode,
76  const char* dirname,
77  const struct superblock* superblock);
78 
79 #endif //EXT_FILESYSTEM_CORE_METHODS_H_
uint16_t get_file_inode_id(int fd, struct inode *inode, const char *dirname, const struct superblock *superblock)
Return inode_id of file.
Definition: methods.c:232
uint16_t create_file_helper(int fd, const struct superblock *superblock, uint16_t parent_node_id)
Helper for create new file Creates file with parent = parent_node_id.
Definition: methods.c:76
Contains superblock struct and its methods.
uint16_t create_dir_helper(int fd, const struct superblock *superblock, uint16_t parent_node_id, bool is_root)
Helper for create new directory Creates dir with parent = parent_node_id (or itself if is_root)...
Definition: methods.c:8
uint16_t get_inode_id_of_dir(int fd, const char *path, const struct superblock *superblock)
Parse path and find inode of this dir.
Definition: methods.c:197
Contains inode struct and its methods.
Contains block struct and its methods.
bool is_dir_exist(int fd, struct inode *inode, const char *dirname, const struct superblock *superblock)
Check if dir exists in inode.
Definition: methods.c:210