• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _CREATE_INODE_H
2 #define _CREATE_INODE_H
3 
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include "et/com_err.h"
8 #include "e2p/e2p.h"
9 #include "ext2fs/ext2fs.h"
10 
11 struct hdlink_s
12 {
13 	dev_t src_dev;
14 	ino_t src_ino;
15 	ext2_ino_t dst_ino;
16 };
17 
18 struct hdlinks_s
19 {
20 	int count;
21 	int size;
22 	struct hdlink_s *hdl;
23 };
24 
25 #define HDLINK_CNT	(4)
26 
27 struct fs_ops_callbacks {
28 	errcode_t (* create_new_inode)(ext2_filsys fs, const char *target_path,
29 		const char *name, ext2_ino_t parent_ino, ext2_ino_t root,
30 		mode_t mode);
31 	errcode_t (* end_create_new_inode)(ext2_filsys fs,
32 		const char *target_path, const char *name,
33 		ext2_ino_t parent_ino, ext2_ino_t root, mode_t mode);
34 };
35 
36 /* For populating the filesystem */
37 extern errcode_t populate_fs(ext2_filsys fs, ext2_ino_t parent_ino,
38 			     const char *source_dir, ext2_ino_t root);
39 extern errcode_t populate_fs2(ext2_filsys fs, ext2_ino_t parent_ino,
40 			      const char *source_dir, ext2_ino_t root,
41 			      struct fs_ops_callbacks *fs_callbacks);
42 extern errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd,
43 				   const char *name, struct stat *st);
44 extern errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd,
45 				     const char *name, char *target,
46 				     ext2_ino_t root);
47 extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd,
48 				   const char *name, ext2_ino_t root);
49 extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd,
50 				   const char *src, const char *dest,
51 				   ext2_ino_t root);
52 
53 #endif /* _CREATE_INODE_H */
54