diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:49:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:49:25 +0000 |
commit | 464df1d5e5ab1322e2dd0a7796939fff1aeefa9a (patch) | |
tree | 6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /misc/create_inode.h | |
parent | Initial commit. (diff) | |
download | e2fsprogs-464df1d5e5ab1322e2dd0a7796939fff1aeefa9a.tar.xz e2fsprogs-464df1d5e5ab1322e2dd0a7796939fff1aeefa9a.zip |
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | misc/create_inode.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/misc/create_inode.h b/misc/create_inode.h new file mode 100644 index 0000000..b5eeb42 --- /dev/null +++ b/misc/create_inode.h @@ -0,0 +1,57 @@ +#ifndef _CREATE_INODE_H +#define _CREATE_INODE_H + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include "et/com_err.h" +#include "e2p/e2p.h" +#include "ext2fs/ext2fs.h" + +struct hdlink_s +{ + dev_t src_dev; + ino_t src_ino; + ext2_ino_t dst_ino; +}; + +struct hdlinks_s +{ + int count; + int size; + struct hdlink_s *hdl; +}; + +#define HDLINK_CNT (4) + +struct fs_ops_callbacks { + errcode_t (* create_new_inode)(ext2_filsys fs, const char *target_path, + const char *name, ext2_ino_t parent_ino, ext2_ino_t root, + mode_t mode); + errcode_t (* end_create_new_inode)(ext2_filsys fs, + const char *target_path, const char *name, + ext2_ino_t parent_ino, ext2_ino_t root, mode_t mode); +}; + +extern int no_copy_xattrs; /* this should eventually be a flag + passed to populate_fs3() */ + +/* For populating the filesystem */ +extern errcode_t populate_fs(ext2_filsys fs, ext2_ino_t parent_ino, + const char *source_dir, ext2_ino_t root); +extern errcode_t populate_fs2(ext2_filsys fs, ext2_ino_t parent_ino, + const char *source_dir, ext2_ino_t root, + struct fs_ops_callbacks *fs_callbacks); +extern errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd, + const char *name, unsigned int st_mode, + unsigned int st_rdev); +extern errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd, + const char *name, char *target, + ext2_ino_t root); +extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd, + const char *name, ext2_ino_t root); +extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd, + const char *src, const char *dest, + ext2_ino_t root); + +#endif /* _CREATE_INODE_H */ |