Optimization for change_file_owner_to_parent() and change_dir_owner_to_parent()