X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fupdate_image.c;h=359dffe304ed77cc448c6fbdb73d68f17fa9fde7;hb=96038b4b60c2b97a83301357b35cc56950eb39b1;hp=b2eceecf760c72319b9fafcf916c531ed22e8101;hpb=3de1ec66f778edda19865482d685bc6f4e17faf7;p=wimlib diff --git a/src/update_image.c b/src/update_image.c index b2eceecf..359dffe3 100644 --- a/src/update_image.c +++ b/src/update_image.c @@ -62,9 +62,6 @@ #include "wimlib/endianness.h" #include "wimlib/error.h" #include "wimlib/metadata.h" -#ifdef WITH_NTFS_3G -# include "wimlib/ntfs_3g.h" /* for do_ntfs_umount() */ -#endif #include "wimlib/paths.h" #include "wimlib/progress.h" #include "wimlib/xml.h" @@ -270,7 +267,7 @@ rollback_link(struct wim_dentry *subject, struct wim_dentry *parent, /* @subject is now unlinked. Add it to orphans. */ list_add(&subject->tmp_list, orphans); - subject->is_orphan = 1; + subject->d_is_orphan = 1; } /* Undo an unlink operation. */ @@ -283,7 +280,7 @@ rollback_unlink(struct wim_dentry *subject, struct wim_dentry *parent, /* @subject is no longer unlinked. Delete it from orphans. */ list_del(&subject->tmp_list); - subject->is_orphan = 0; + subject->d_is_orphan = 0; } /* Rollback a name change operation. */ @@ -318,13 +315,13 @@ rollback_update_primitive(const struct update_primitive *prim, break; case CHANGE_FILE_NAME: rollback_name_change(prim->name.old_name, - &prim->name.subject->file_name, - &prim->name.subject->file_name_nbytes); + &prim->name.subject->d_name, + &prim->name.subject->d_name_nbytes); break; case CHANGE_SHORT_NAME: rollback_name_change(prim->name.old_name, - &prim->name.subject->short_name, - &prim->name.subject->short_name_nbytes); + &prim->name.subject->d_short_name, + &prim->name.subject->d_short_name_nbytes); break; } } @@ -365,9 +362,9 @@ journaled_link(struct update_command_journal *j, do_link(subject, parent, j->root_p); - if (subject->is_orphan) { + if (subject->d_is_orphan) { list_del(&subject->tmp_list); - subject->is_orphan = 0; + subject->d_is_orphan = 0; } return 0; } @@ -398,7 +395,7 @@ journaled_unlink(struct update_command_journal *j, struct wim_dentry *subject) do_unlink(subject, parent, j->root_p); list_add(&subject->tmp_list, &j->orphans); - subject->is_orphan = 1; + subject->d_is_orphan = 1; return 0; } @@ -423,26 +420,26 @@ journaled_change_name(struct update_command_journal *j, prim.type = CHANGE_FILE_NAME; prim.name.subject = dentry; - prim.name.old_name = dentry->file_name; + prim.name.old_name = dentry->d_name; ret = record_update_primitive(j, prim); if (ret) { FREE(new_name); return ret; } - dentry->file_name = new_name; - dentry->file_name_nbytes = new_name_nbytes; + dentry->d_name = new_name; + dentry->d_name_nbytes = new_name_nbytes; /* Clear the short name. */ prim.type = CHANGE_SHORT_NAME; prim.name.subject = dentry; - prim.name.old_name = dentry->short_name; + prim.name.old_name = dentry->d_short_name; ret = record_update_primitive(j, prim); if (ret) return ret; - dentry->short_name = NULL; - dentry->short_name_nbytes = 0; + dentry->d_short_name = NULL; + dentry->d_short_name_nbytes = 0; return 0; } @@ -516,8 +513,8 @@ handle_conflict(struct wim_dentry *branch, struct wim_dentry *existing, existing_child = get_dentry_child_with_utf16le_name(existing, - new_child->file_name, - new_child->file_name_nbytes, + new_child->d_name, + new_child->d_name_nbytes, WIMLIB_CASE_PLATFORM_DEFAULT); unlink_dentry(new_child); if (existing_child) { @@ -792,10 +789,6 @@ execute_add_command(struct update_command_journal *j, struct capture_params params; struct capture_config config; capture_tree_t capture_tree = platform_default_capture_tree; -#ifdef WITH_NTFS_3G - struct _ntfs_volume *ntfs_vol = NULL; -#endif - void *extra_arg = NULL; struct wim_dentry *branch; add_flags = add_cmd->add.add_flags; @@ -809,15 +802,8 @@ execute_add_command(struct update_command_journal *j, memset(¶ms, 0, sizeof(params)); #ifdef WITH_NTFS_3G - if (add_flags & WIMLIB_ADD_FLAG_NTFS) { - capture_tree = build_dentry_tree_ntfs; - extra_arg = &ntfs_vol; - if (wim_get_current_image_metadata(wim)->ntfs_vol != NULL) { - ERROR("NTFS volume already set"); - ret = WIMLIB_ERR_INVALID_PARAM; - goto out; - } - } + if (add_flags & WIMLIB_ADD_FLAG_NTFS) + capture_tree = ntfs_3g_build_dentry_tree; #endif ret = get_capture_config(config_file, &config, @@ -831,7 +817,6 @@ execute_add_command(struct update_command_journal *j, params.sd_set = sd_set; params.config = &config; params.add_flags = add_flags; - params.extra_arg = extra_arg; params.progfunc = wim->progfunc; params.progctx = wim->progctx; @@ -852,7 +837,7 @@ execute_add_command(struct update_command_journal *j, ¶ms.progress, params.progctx); if (ret) { free_dentry_tree(branch, wim->blob_table); - goto out_cleanup_after_capture; + goto out_destroy_config; } if (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path) && @@ -861,13 +846,13 @@ execute_add_command(struct update_command_journal *j, ERROR("\"%"TS"\" is not a directory!", fs_source_path); ret = WIMLIB_ERR_NOTDIR; free_dentry_tree(branch, wim->blob_table); - goto out_cleanup_after_capture; + goto out_destroy_config; } ret = attach_branch(branch, wim_target_path, j, add_flags, params.progfunc, params.progctx); if (ret) - goto out_cleanup_after_capture; + goto out_destroy_config; if (config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT) && WIMLIB_IS_WIM_ROOT_PATH(wim_target_path)) @@ -881,23 +866,14 @@ execute_add_command(struct update_command_journal *j, * /Windows/System32/WimBootCompress.ini in the WIM image. */ ret = platform_default_capture_tree(&branch, config_file, ¶ms); if (ret) - goto out_cleanup_after_capture; + goto out_destroy_config; ret = attach_branch(branch, wimboot_cfgfile, j, 0, NULL, NULL); if (ret) - goto out_cleanup_after_capture; + goto out_destroy_config; } -#ifdef WITH_NTFS_3G - wim_get_current_image_metadata(wim)->ntfs_vol = ntfs_vol; -#endif ret = 0; - goto out_destroy_config; -out_cleanup_after_capture: -#ifdef WITH_NTFS_3G - if (ntfs_vol) - do_ntfs_umount(ntfs_vol); -#endif out_destroy_config: destroy_capture_config(&config); out: @@ -1252,9 +1228,8 @@ check_add_command(struct wimlib_update_command *cmd, #ifndef WITH_NTFS_3G if (add_flags & WIMLIB_ADD_FLAG_NTFS) { - ERROR("wimlib was compiled without support for NTFS-3g, so\n" - " we cannot capture a WIM image directly " - "from an NTFS volume"); + ERROR("NTFS-3g capture mode is unsupported because wimlib " + "was compiled --without-ntfs-3g"); return WIMLIB_ERR_UNSUPPORTED; } #endif @@ -1299,12 +1274,6 @@ check_add_command(struct wimlib_update_command *cmd, } if (!is_entire_image) { - if (add_flags & WIMLIB_ADD_FLAG_NTFS) { - ERROR("Cannot add directly from an NTFS volume " - "when not capturing a full image!"); - return WIMLIB_ERR_INVALID_PARAM; - } - if (add_flags & WIMLIB_ADD_FLAG_RPFIX) { ERROR("Cannot do reparse point fixups when " "not capturing a full image!");