X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=misc%2Fcreate_inode.h;h=17309c68452895c3ed12ffc397ff42d36527975a;hb=09703204f70c5e3174a99e3b4e1bd85a3870390b;hp=79742e84bcfd3220883216129a04eb8568065fcc;hpb=8f8d8a575be5ee7c01438c98ff001ce0bc054115;p=tools%2Fe2fsprogs.git diff --git a/misc/create_inode.h b/misc/create_inode.h index 79742e8..17309c6 100644 --- a/misc/create_inode.h +++ b/misc/create_inode.h @@ -7,34 +7,47 @@ #include "et/com_err.h" #include "e2p/e2p.h" #include "ext2fs/ext2fs.h" -#include "nls-enable.h" struct hdlink_s { - ext2_ino_t src_ino; + dev_t src_dev; + ino_t src_ino; ext2_ino_t dst_ino; }; struct hdlinks_s { int count; + int size; struct hdlink_s *hdl; }; -struct hdlinks_s hdlinks; +#define HDLINK_CNT (4) -ext2_filsys current_fs; -ext2_ino_t root; - -/* For saving the hard links */ -#define HDLINK_CNT 4 -extern int hdlink_cnt; +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); +}; /* For populating the filesystem */ -extern errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir); -extern errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st); -extern errcode_t do_symlink_internal(ext2_ino_t cwd, const char *name, char *target); -extern errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st); -extern errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest); +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, struct stat *st); +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 */