]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - misc/create_inode.h
mke2fs: the -d option can now handle tarball input
[thirdparty/e2fsprogs.git] / misc / create_inode.h
CommitLineData
8f8d8a57
DW
1#ifndef _CREATE_INODE_H
2#define _CREATE_INODE_H
3
0d4deba2
RY
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"
0d4deba2 10
f84894bc
RY
11struct hdlink_s
12{
b99888a0
DW
13 dev_t src_dev;
14 ino_t src_ino;
f84894bc
RY
15 ext2_ino_t dst_ino;
16};
17
18struct hdlinks_s
19{
20 int count;
b99888a0 21 int size;
f84894bc
RY
22 struct hdlink_s *hdl;
23};
24
7e3a4f0a
JSMR
25struct file_info {
26 char *path;
27 size_t path_len;
28 size_t path_max_len;
29};
30
b99888a0 31#define HDLINK_CNT (4)
f84894bc 32
9d25d462
AS
33struct fs_ops_callbacks {
34 errcode_t (* create_new_inode)(ext2_filsys fs, const char *target_path,
35 const char *name, ext2_ino_t parent_ino, ext2_ino_t root,
36 mode_t mode);
37 errcode_t (* end_create_new_inode)(ext2_filsys fs,
38 const char *target_path, const char *name,
39 ext2_ino_t parent_ino, ext2_ino_t root, mode_t mode);
40};
41
8cec4acd
TT
42extern int no_copy_xattrs; /* this should eventually be a flag
43 passed to populate_fs3() */
44
0d4deba2 45/* For populating the filesystem */
a3111e80
DW
46extern errcode_t populate_fs(ext2_filsys fs, ext2_ino_t parent_ino,
47 const char *source_dir, ext2_ino_t root);
9d25d462
AS
48extern errcode_t populate_fs2(ext2_filsys fs, ext2_ino_t parent_ino,
49 const char *source_dir, ext2_ino_t root,
50 struct fs_ops_callbacks *fs_callbacks);
a3111e80 51extern errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd,
47e61052
TT
52 const char *name, unsigned int st_mode,
53 unsigned int st_rdev);
a3111e80
DW
54extern errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd,
55 const char *name, char *target,
56 ext2_ino_t root);
57extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd,
25f291c9 58 const char *name, ext2_ino_t root);
a3111e80
DW
59extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd,
60 const char *src, const char *dest,
61 ext2_ino_t root);
7e3a4f0a
JSMR
62extern errcode_t add_link(ext2_filsys fs, ext2_ino_t parent_ino,
63 ext2_ino_t ino, const char *name);
64extern errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino,
65 const struct stat *st);
8f8d8a57
DW
66
67#endif /* _CREATE_INODE_H */