Lines Matching refs:vol

390 static int sanity_indx(ntfs_volume *vol, const char *buffer)
405 != (vol->indx_record_size - 24))) {
409 (long)(vol->indx_record_size - 24),
424 static char *read_raw(ntfs_volume *vol, const LOG_RECORD *logr)
460 && (ntfs_pread(vol->dev, lcn << clusterbits,
492 static int write_raw(ntfs_volume *vol, const LOG_RECORD *logr,
532 if (ntfs_pwrite(vol->dev, lcn << clusterbits,
547 static int write_mirr(ntfs_volume *vol, const LOG_RECORD *logr,
562 lcn = ntfs_attr_vcn_to_lcn(vol->mftmirr_na,
566 || (ntfs_pwrite(vol->dev, lcn << clusterbits,
581 static char *read_protected(ntfs_volume *vol, const LOG_RECORD *logr,
590 buffer = read_raw(vol, logr);
629 static int write_protected(ntfs_volume *vol, const LOG_RECORD *logr,
666 <= (((u64)vol->mftmirr_size) << mftrecbits);
669 if ((size == vol->indx_record_size) && !memcmp(buffer,"INDX",4)) {
679 err = sanity_indx(vol, buffer);
696 full = read_raw(vol, logr);
701 err = write_raw(vol, logr, full);
703 err = write_mirr(vol, logr,
710 err = write_raw(vol, logr, buffer);
712 err = write_mirr(vol, logr, buffer);
797 static int adjust_high_vcn(ntfs_volume *vol, ATTR_RECORD *attr)
806 rl = ntfs_mapping_pairs_decompress(vol, attr, (runlist_element*)NULL);
862 static int change_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
905 err = write_protected(vol, &action->record,
916 static int change_resident_expect(ntfs_volume *vol, const struct ACTION_RECORD *action,
953 err = write_protected(vol, &action->record,
969 static int change_index_value(ntfs_volume *vol, const struct ACTION_RECORD *action,
985 xsize = vol->indx_record_size;
999 err = write_protected(vol, &action->record,
1014 static int add_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
1064 err = write_protected(vol, &action->record,
1079 static int delete_non_resident(void /*ntfs_volume *vol,
1094 static int expand_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
1146 err = write_protected(vol, &action->record,
1161 static int add_non_resident(void /*ntfs_volume *vol,
1176 static int insert_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
1244 err = write_protected(vol, &action->record,
1259 static int remove_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
1330 err = write_protected(vol, &action->record,
1345 static int delete_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
1392 err = write_protected(vol, &action->record,
1403 static int shrink_resident(ntfs_volume *vol, const struct ACTION_RECORD *action,
1473 err = write_protected(vol, &action->record,
1484 static int update_index(ntfs_volume *vol, const struct ACTION_RECORD *action,
1499 xsize = vol->indx_record_size;
1519 err = write_protected(vol, &action->record,
1606 static int insert_index_allocation(ntfs_volume *vol, char *buffer, u32 offs)
1666 xsize = vol->indx_record_size;
1783 static int create_indx(ntfs_volume *vol, const struct ACTION_RECORD *action,
1810 cpu_to_le32(vol->indx_record_size - 24);
1814 ixhead->length = cpu_to_le16(vol->indx_record_size - 24);
1825 static int redo_action37(ntfs_volume *vol, const struct ACTION_RECORD *action,
1844 err = write_protected(vol, &action->record,
1860 static int redo_add_index(ntfs_volume *vol, const struct ACTION_RECORD *action,
1886 xsize = vol->indx_record_size;
1912 err = write_protected(vol, &action->record,
1923 static int redo_add_root_index(ntfs_volume *vol,
1976 err = write_protected(vol, &action->record,
1987 static int redo_compensate(ntfs_volume *vol __attribute__((unused)),
2003 static int redo_create_file(ntfs_volume *vol,
2043 err = write_protected(vol, &action->record,
2056 static int redo_create_attribute(ntfs_volume *vol,
2074 err = insert_resident(vol, action, buffer, data,
2079 static int redo_delete_attribute(ntfs_volume *vol,
2096 err = remove_resident(vol, action, buffer, data,
2101 static int redo_delete_file(ntfs_volume *vol,
2143 err = write_protected(vol, &action->record,
2154 static int redo_delete_index(ntfs_volume *vol,
2180 xsize = vol->indx_record_size;
2203 err = write_protected(vol, &action->record,
2214 static int redo_delete_root_index(ntfs_volume *vol,
2270 err = write_protected(vol, &action->record,
2281 static int redo_force_bits(ntfs_volume *vol,
2314 if (!write_raw(vol, &action->record, buffer)) {
2324 static int redo_open_attribute(ntfs_volume *vol __attribute__((unused)),
2405 static int redo_sizes(ntfs_volume *vol, const struct ACTION_RECORD *action,
2422 err = change_resident(vol, action, buffer,
2427 static int redo_update_index(ntfs_volume *vol,
2445 err = update_index(vol, action, buffer, data, target, length);
2449 static int redo_update_index_value(ntfs_volume *vol,
2465 err = change_index_value(vol, action, buffer, data, target, length);
2469 static int redo_update_mapping(ntfs_volume *vol,
2538 err = adjust_high_vcn(vol, attr);
2544 err = write_protected(vol,
2557 static int redo_update_resident(ntfs_volume *vol,
2607 err = write_protected(vol, &action->record,
2617 err = expand_resident(vol, action, buffer, data,
2620 err = shrink_resident(vol, action, buffer, data,
2626 static int redo_update_root_index(ntfs_volume *vol,
2650 err = change_resident(vol, action, buffer, data,
2653 err = change_resident_expect(vol, action, buffer, data,
2658 static int redo_update_root_vcn(ntfs_volume *vol,
2680 err = change_resident_expect(vol, action, buffer, data,
2686 static int redo_update_value(ntfs_volume *vol,
2741 err = write_raw(vol, &action->record, buffer);
2752 static int redo_update_vcn(ntfs_volume *vol,
2771 err = update_index(vol, action, buffer, data, target, length);
2776 static int redo_write_end(ntfs_volume *vol,
2824 err = write_protected(vol, &action->record,
2834 err = add_resident(vol, action, buffer, data,
2837 err = delete_resident(vol, action, buffer, data,
2843 static int redo_write_index(ntfs_volume *vol,
2869 xsize = vol->indx_record_size;
2894 err = write_protected(vol, &action->record,
2905 static int undo_action37(ntfs_volume *vol __attribute__((unused)),
2932 static int undo_add_index(ntfs_volume *vol,
2958 xsize = vol->indx_record_size;
2979 err = write_protected(vol, &action->record,
2982 sanity_indx(vol,buffer);
2994 static int undo_add_root_index(ntfs_volume *vol,
3046 err = write_protected(vol, &action->record,
3057 static int undo_create_attribute(ntfs_volume *vol,
3074 err = remove_resident(vol, action, buffer, data,
3079 static int undo_delete_attribute(ntfs_volume *vol,
3096 err = insert_resident(vol, action, buffer, data,
3101 static int undo_delete_index(ntfs_volume *vol,
3128 xsize = vol->indx_record_size;
3138 && !sanity_indx(vol,buffer)) {
3157 err = write_protected(vol, &action->record,
3168 static int undo_delete_root_index(ntfs_volume *vol,
3230 err = write_protected(vol, &action->record,
3241 static int undo_create_file(ntfs_volume *vol,
3282 err = write_protected(vol, &action->record,
3293 static int undo_delete_file(ntfs_volume *vol,
3350 err = write_protected(vol,
3362 static int undo_force_bits(ntfs_volume *vol,
3395 if (!write_raw(vol, &action->record, buffer)) {
3405 static int undo_open_attribute(ntfs_volume *vol __attribute__((unused)),
3475 static int undo_sizes(ntfs_volume *vol,
3497 err = change_resident(vol, action, buffer,
3504 err = insert_index_allocation(vol, buffer, offs);
3506 err = change_resident(vol, action, buffer,
3509 err = change_resident(vol, action, buffer,
3515 static int undo_update_index(ntfs_volume *vol, const struct ACTION_RECORD *action,
3533 err = update_index(vol, action, buffer, data, target, length);
3537 static int undo_update_index_value(ntfs_volume *vol,
3564 if ((target + length) <= vol->indx_record_size) {
3573 err = write_protected(vol, &action->record, buffer,
3574 vol->indx_record_size);
3584 static int undo_update_vcn(ntfs_volume *vol, const struct ACTION_RECORD *action,
3603 err = update_index(vol, action, buffer, data, target, length);
3608 static int undo_update_mapping(ntfs_volume *vol, const struct ACTION_RECORD *action,
3678 err = adjust_high_vcn(vol, attr);
3684 err = write_protected(vol,
3697 static int undo_update_resident(ntfs_volume *vol,
3744 err = write_protected(vol, &action->record,
3754 err = expand_resident(vol, action, buffer, data,
3757 err = shrink_resident(vol, action, buffer, data,
3763 static int undo_update_root_index(ntfs_volume *vol,
3785 err = change_resident_expect(vol, action, buffer, data, expected,
3790 static int undo_update_root_vcn(ntfs_volume *vol,
3812 err = change_resident_expect(vol, action, buffer, data,
3818 static int undo_update_value(ntfs_volume *vol,
3857 err = write_raw(vol, &action->record, buffer);
3878 static int undo_write_end(ntfs_volume *vol,
3926 err = write_protected(vol, &action->record,
3936 err = add_resident(vol, action, buffer, data,
3939 err = delete_resident(vol, action, buffer, data,
3945 static int undo_write_index(ntfs_volume *vol,
3993 err = write_protected(vol, &action->record,
4003 err = add_non_resident(/*vol, action, data,
4006 err = delete_non_resident(/*vol, action, data,
4096 static int distribute_redos(ntfs_volume *vol,
4109 err = redo_add_index(vol, action, buffer);
4114 err = redo_add_root_index(vol, action, buffer);
4121 err = redo_force_bits(vol, action, buffer);
4126 err = redo_compensate(vol, action, buffer);
4133 err = redo_create_attribute(vol, action, buffer);
4140 err = redo_delete_file(vol, action, buffer);
4147 err = redo_delete_attribute(vol, action, buffer);
4154 err = redo_delete_index(vol, action, buffer);
4161 err = redo_delete_root_index(vol, action, buffer);
4166 err = redo_create_file(vol, action, buffer);
4171 err = redo_open_attribute(vol, action);
4176 err = redo_force_bits(vol, action, buffer);
4183 err = redo_update_vcn(vol, action, buffer);
4188 err = redo_update_root_vcn(vol, action, buffer);
4195 err = redo_sizes(vol, action, buffer);
4202 err = redo_update_index(vol, action, buffer);
4209 err = redo_update_root_index(vol, action, buffer);
4214 err = redo_update_mapping(vol, action, buffer);
4219 err = redo_update_index_value(vol, action, buffer);
4222 err = redo_update_value(vol, action, buffer);
4234 err = redo_update_resident(vol, action, buffer);
4239 err = redo_action37(vol, action, buffer);
4244 err = redo_write_end(vol, action, buffer);
4251 err = redo_write_index(vol, action, buffer);
4282 static int play_one_redo(ntfs_volume *vol, const struct ACTION_RECORD *action)
4388 buffer = read_protected(vol, &action->record,
4426 xsize = vol->indx_record_size;
4430 buffer = read_protected(vol, &action->record,
4470 buffer = read_raw(vol, &action->record);
4480 err = distribute_redos(vol, action, buffer);
4502 int play_redos(ntfs_volume *vol, const struct ACTION_RECORD *firstaction)
4513 err = play_one_redo(vol, action);
4520 static int distribute_undos(ntfs_volume *vol, const struct ACTION_RECORD *action,
4533 err = undo_add_index(vol, action, buffer);
4538 err = undo_add_root_index(vol, action, buffer);
4543 err = undo_force_bits(vol, action, buffer);
4548 err = undo_create_attribute(vol, action, buffer);
4553 err = undo_delete_file(vol, action, buffer);
4558 err = undo_delete_attribute(vol, action, buffer);
4563 err = undo_delete_index(vol, action, buffer);
4568 err = undo_delete_root_index(vol, action, buffer);
4573 err = undo_create_file(vol, action, buffer);
4578 err = undo_open_attribute(vol, action);
4583 err = undo_force_bits(vol, action, buffer);
4588 err = undo_update_vcn(vol, action, buffer);
4593 err = undo_update_root_vcn(vol, action, buffer);
4598 err = undo_sizes(vol, action, buffer);
4603 err = undo_update_index(vol, action, buffer);
4608 err = undo_update_root_index(vol, action, buffer);
4613 err = undo_update_mapping(vol, action, buffer);
4618 err = undo_update_index_value(vol, action, buffer);
4621 err = undo_update_value(vol, action, buffer);
4631 err = undo_update_resident(vol, action, buffer);
4636 err = undo_action37(vol, action, buffer);
4641 err = undo_write_end(vol, action, buffer);
4646 err = undo_write_index(vol, action, buffer);
4673 static int play_one_undo(ntfs_volume *vol, const struct ACTION_RECORD *action)
4767 buffer = read_protected(vol, &action->record, mftrecsz, TRUE);
4806 xsize = vol->indx_record_size;
4807 buffer = read_protected(vol, &action->record, xsize, TRUE);
4846 err = create_indx(vol,
4859 buffer = read_raw(vol, &action->record);
4871 err = distribute_undos(vol, action, buffer);
4890 int play_undos(ntfs_volume *vol, const struct ACTION_RECORD *lastaction)
4899 err = play_one_undo(vol, action);