-build_dentry_tree_ntfs_recursive(struct wim_dentry **root_ret,
- ntfs_inode *ni,
- char *path,
- size_t path_len,
- int name_type,
- struct ntfs_volume_wrapper *volume,
- struct capture_params *params)
+ntfs_3g_recurse_directory(ntfs_inode *ni, char *path, size_t path_len,
+ struct wim_dentry *parent,
+ struct ntfs_volume_wrapper *volume,
+ struct capture_params *params)
+{
+ int ret;
+ s64 pos = 0;
+ struct readdir_ctx ctx = {
+ .parent = parent,
+ .path = path,
+ .path_len = path_len,
+ .dos_name_map = { .root = NULL },
+ .volume = volume,
+ .params = params,
+ .ret = 0,
+ };
+ ret = ntfs_readdir(ni, &pos, &ctx, filldir);
+ path[path_len] = '\0';
+ if (unlikely(ret)) {
+ if (ctx.ret) {
+ /* wimlib error */
+ ret = ctx.ret;
+ } else {
+ /* error from ntfs_readdir() itself */
+ ERROR_WITH_ERRNO("Error reading directory \"%s\"", path);
+ ret = WIMLIB_ERR_NTFS_3G;
+ }
+ } else {
+ struct wim_dentry *child;
+
+ ret = 0;
+ for_dentry_child(child, parent) {
+ ret = set_dentry_dos_name(child, &ctx.dos_name_map);
+ if (ret)
+ break;
+ }
+ }
+ destroy_dos_name_map(&ctx.dos_name_map);
+ return ret;
+}
+
+static int
+ntfs_3g_build_dentry_tree_recursive(struct wim_dentry **root_ret,
+ const MFT_REF mref,
+ char *path,
+ size_t path_len,
+ int name_type,
+ struct ntfs_volume_wrapper *volume,
+ struct capture_params *params)