Lines Matching refs:record
85 /* check whether a MFT or INDX record is older than action */
88 /* check whether a MFT or INDX record is newer than action */
274 printf("** Invalid index record"
282 printf("** Invalid index record length %d\n",
289 printf("** Bad index record length %ld (computed %ld)\n",
301 * Rough check of sanity of an mft record
306 const MFT_RECORD *record;
317 record = (const MFT_RECORD*)buffer;
318 nextinstance = le16_to_cpu(record->next_attr_instance);
320 k = le16_to_cpu(record->attrs_offset);
374 || (le32_to_cpu(record->bytes_in_use) != (k + 8))
375 || (le32_to_cpu(record->bytes_allocated) < (k + 8))) {
376 printf("** Bad MFT record length %ld"
378 (long)le32_to_cpu(record->bytes_in_use),
380 (long)le32_to_cpu(record->bytes_allocated));
578 * Allocate a buffer and read a single protected record
592 * if the record is smaller than a cluster,
609 printf("** Invalid protected record at 0x%llx"
621 * Protect a single record, write, and deallocate the buffer
625 * As the store only knows about clusters, if the record is smaller
632 MFT_RECORD *record;
644 record = (MFT_RECORD*)buffer;
647 " (record %s than action 0x%llx)\n",
648 (long)le32_to_cpu(record->mft_record_number),
649 (long long)sle64_to_cpu(record->lsn),
650 ((s64)(sle64_to_cpu(record->lsn)
661 record->lsn = logr->this_lsn;
686 printf("** Error : writing protected record of unknown type\n");
692 * If the record is smaller than a cluster, get a full
715 printf("** Failed to protect record\n");
726 * and MFT record must be kept aligned to 8 bytes.
828 * sizes, but the lsn is not updated in the index record.
830 * and the actual record does not fully match the undo data.
872 if (action->record.undo_length != action->record.redo_length)
875 lcn = sle64_to_cpu(action->record.lcn_list[0]);
877 (long long)inode_number(&action->record),
881 + le16_to_cpu(action->record.record_offset));
883 printf("-> existing record :\n");
885 printf("-> full MFT record :\n");
888 attrend = le16_to_cpu(action->record.record_offset)
902 printf("-> new record :\n");
905 err = write_protected(vol, &action->record,
909 printf("-> MFT record %s\n",
926 if (action->record.undo_length != action->record.redo_length)
929 lcn = sle64_to_cpu(action->record.lcn_list[0]);
931 (long long)inode_number(&action->record),
935 + le16_to_cpu(action->record.record_offset));
937 printf("-> existing record :\n");
939 printf("-> full record :\n");
950 printf("-> new record :\n");
953 err = write_protected(vol, &action->record,
957 printf("-> MFT record %s\n",
979 count = le16_to_cpu(action->record.lcns_to_follow);
981 lcn = sle64_to_cpu(action->record.lcn_list[0]);
987 printf("-> existing record :\n");
996 printf("-> new record :\n");
999 err = write_protected(vol, &action->record,
1003 printf("-> data record %s\n",
1026 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1028 (long long)inode_number(&action->record),
1064 err = write_protected(vol, &action->record,
1068 printf("-> MFT record %s\n",
1108 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1110 (long long)inode_number(&action->record),
1115 + le16_to_cpu(action->record.record_offset));
1146 err = write_protected(vol, &action->record,
1150 printf("-> MFT record %s\n",
1191 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1193 (long long)inode_number(&action->record),
1198 + le16_to_cpu(action->record.record_offset));
1201 printf("existing record :\n");
1204 printf("** Bad attribute order, full record :\n");
1226 if (action->record.redo_operation
1239 printf("expanded record (now 0x%x"
1244 err = write_protected(vol, &action->record,
1248 printf("-> MFT record %s\n",
1273 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1275 (long long)inode_number(&action->record),
1280 + le16_to_cpu(action->record.record_offset));
1282 printf("existing record :\n");
1300 printf("The existing record does not match (%d/%d)\n",
1306 - le16_to_cpu(action->record.record_offset));
1314 if (action->record.redo_operation
1325 printf("new record at same location"
1330 err = write_protected(vol, &action->record,
1334 printf("-> MFT record %s\n",
1359 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1361 (long long)inode_number(&action->record),
1392 err = write_protected(vol, &action->record,
1396 printf("-> MFT record %s\n",
1419 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1421 (long long)inode_number(&action->record),
1426 + le16_to_cpu(action->record.record_offset));
1451 /* Relocate end of record */
1473 err = write_protected(vol, &action->record,
1477 printf("-> MFT record %s\n",
1495 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1501 + le16_to_cpu(action->record.record_offset));
1519 err = write_protected(vol, &action->record,
1523 printf("-> INDX record %s\n",
1536 MFT_RECORD *record;
1543 record = (MFT_RECORD*)buffer;
1544 pos = le16_to_cpu(record->attrs_offset);
1545 used = le32_to_cpu(record->bytes_in_use);
1562 record->bytes_in_use = cpu_to_le32(used);
1563 record->link_count = cpu_to_le16(0);
1608 MFT_RECORD *record;
1625 record = (MFT_RECORD*)buffer;
1626 pos = le16_to_cpu(record->attrs_offset);
1627 used = le32_to_cpu(record->bytes_in_use);
1643 record->bytes_in_use = cpu_to_le32(used + addedlength);
1658 attr->instance = record->next_attr_instance;
1659 instance = le16_to_cpu(record->next_attr_instance) + 1;
1660 record->next_attr_instance = cpu_to_le16(instance);
1689 attr->instance = record->next_attr_instance;
1690 instance = le16_to_cpu(record->next_attr_instance) + 1;
1691 record->next_attr_instance = cpu_to_le16(instance);
1702 * Check whether a full MFT record is fed by an action
1704 * If so, checking the validity of existing record is pointless
1709 const MFT_RECORD *record;
1716 record = (const MFT_RECORD*)((const char*)&action->record
1717 + get_redo_offset(&action->record));
1718 length = le16_to_cpu(action->record.redo_length);
1720 record = (const MFT_RECORD*)((const char*)&action->record
1721 + get_undo_offset(&action->record));
1722 length = le16_to_cpu(action->record.undo_length);
1725 ok = !action->record.record_offset
1726 && !action->record.attribute_offset
1727 && (record->magic == magic_FILE)
1730 + sizeof(record->bytes_in_use)));
1732 k = le16_to_cpu(record->attrs_offset);
1733 attr = (const ATTR_RECORD*)((const char*)record + k);
1738 attr = (const ATTR_RECORD*)((const char*)record + k);
1748 * Check whether a full index block is fed by the log record
1750 * If so, checking the validity of existing record is pointless
1759 indx = (const INDEX_BLOCK*)((const char*)&action->record
1760 + get_redo_offset(&action->record));
1761 length = le16_to_cpu(action->record.redo_length);
1763 indx = (const INDEX_BLOCK*)((const char*)&action->record
1764 + get_undo_offset(&action->record));
1765 length = le16_to_cpu(action->record.undo_length);
1768 return (!action->record.record_offset
1769 && !action->record.attribute_offset
1802 indx->lsn = action->record.this_lsn;
1803 vcn = sle64_to_cpu(action->record.target_vcn);
1835 length = le16_to_cpu(action->record.redo_length);
1836 target = le16_to_cpu(action->record.record_offset)
1837 + le16_to_cpu(action->record.attribute_offset);
1844 err = write_protected(vol, &action->record,
1847 printf("-> MFT record trimmed\n");
1850 printf("** Bad action-37, inode %lld record :\n",
1851 (long long)inode_number(&action->record));
1876 data = ((const char*)&action->record)
1877 + get_redo_offset(&action->record);
1878 length = le16_to_cpu(action->record.redo_length);
1879 target = le16_to_cpu(action->record.record_offset)
1880 + le16_to_cpu(action->record.attribute_offset);
1882 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1888 + le16_to_cpu(action->record.record_offset));
1890 printf("-> existing record :\n");
1909 printf("-> inserted record :\n");
1912 err = write_protected(vol, &action->record,
1916 printf("-> INDX record %s\n",
1939 data = ((const char*)&action->record)
1940 + get_redo_offset(&action->record);
1941 length = le16_to_cpu(action->record.redo_length);
1942 target = le16_to_cpu(action->record.record_offset)
1943 + le16_to_cpu(action->record.attribute_offset);
1945 lcn = sle64_to_cpu(action->record.lcn_list[0]);
1947 (long long)inode_number(&action->record),
1952 + le16_to_cpu(action->record.record_offset));
1976 err = write_protected(vol, &action->record,
1980 printf("-> MFT record %s\n",
1996 lsn = sle64_to_cpu(action->record.this_lsn);
2008 MFT_RECORD *record;
2017 data = ((const char*)&action->record)
2018 + get_redo_offset(&action->record);
2019 length = le16_to_cpu(action->record.redo_length);
2020 target = le16_to_cpu(action->record.record_offset)
2021 + le16_to_cpu(action->record.attribute_offset);
2023 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2025 (long long)inode_number(&action->record),
2028 record = (MFT_RECORD*)buffer;
2030 printf("-> existing record :\n");
2036 if (changed || !(record->flags & MFT_RECORD_IN_USE)) {
2038 record->flags |= MFT_RECORD_IN_USE;
2040 printf("-> new record :\n");
2043 err = write_protected(vol, &action->record,
2047 printf("-> MFT record %s\n",
2051 err = 1; /* record overflows */
2067 data = ((const char*)&action->record)
2068 + get_redo_offset(&action->record);
2069 length = le16_to_cpu(action->record.redo_length);
2070 target = le16_to_cpu(action->record.record_offset)
2071 + le16_to_cpu(action->record.attribute_offset);
2073 if (!action->record.undo_length)
2090 data = ((const char*)&action->record)
2091 + get_undo_offset(&action->record);
2092 length = le16_to_cpu(action->record.undo_length);
2093 target = le16_to_cpu(action->record.record_offset)
2094 + le16_to_cpu(action->record.attribute_offset);
2095 if (!action->record.redo_length)
2106 MFT_RECORD *record;
2115 data = ((const char*)&action->record)
2116 + get_undo_offset(&action->record);
2117 length = le16_to_cpu(action->record.undo_length);
2118 target = le16_to_cpu(action->record.record_offset)
2119 + le16_to_cpu(action->record.attribute_offset);
2121 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2123 (long long)inode_number(&action->record),
2127 printf("-> existing record :\n");
2130 record = (MFT_RECORD*)buffer;
2134 || (record->flags & MFT_RECORD_IN_USE);
2138 record->flags &= ~MFT_RECORD_IN_USE;
2140 printf("-> new record :\n");
2143 err = write_protected(vol, &action->record,
2147 printf("-> MFT record %s\n",
2170 data = ((const char*)&action->record)
2171 + get_undo_offset(&action->record);
2172 length = le16_to_cpu(action->record.undo_length);
2173 target = le16_to_cpu(action->record.record_offset)
2174 + le16_to_cpu(action->record.attribute_offset);
2176 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2182 + le16_to_cpu(action->record.record_offset));
2184 printf("-> existing record :\n");
2191 found = (action->record.undo_operation
2203 err = write_protected(vol, &action->record,
2207 printf("-> INDX record %s\n",
2230 data = ((const char*)&action->record)
2231 + get_undo_offset(&action->record);
2232 length = le16_to_cpu(action->record.undo_length);
2233 target = le16_to_cpu(action->record.record_offset)
2234 + le16_to_cpu(action->record.attribute_offset);
2237 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2239 (long long)inode_number(&action->record),
2244 + le16_to_cpu(action->record.record_offset));
2255 found = (action->record.undo_operation
2270 err = write_protected(vol, &action->record,
2274 printf("-> MFT record %s\n",
2296 (((const char*)&action->record)
2297 + get_redo_offset(&action->record));
2300 if (action->record.redo_operation
2308 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2314 if (!write_raw(vol, &action->record, buffer)) {
2317 printf("-> record updated\n");
2341 data = ((const char*)&action->record)
2342 + get_redo_offset(&action->record);
2343 length = le16_to_cpu(action->record.redo_length);
2344 extra = get_extra_offset(&action->record);
2345 if (action->record.undo_length) {
2346 name = ((const char*)&action->record) + extra;
2347 namelen = le32_to_cpu(action->record.client_data_length)
2360 pa = getattrentry(le16_to_cpu(action->record.target_attribute),0);
2416 data = ((const char*)&action->record)
2417 + get_redo_offset(&action->record);
2418 length = le16_to_cpu(action->record.redo_length);
2419 target = le16_to_cpu(action->record.record_offset)
2420 + le16_to_cpu(action->record.attribute_offset)
2438 data = ((const char*)&action->record)
2439 + get_redo_offset(&action->record);
2440 length = le16_to_cpu(action->record.redo_length);
2442 target = le16_to_cpu(action->record.record_offset)
2443 + le16_to_cpu(action->record.attribute_offset)
2460 data = ((const char*)&action->record)
2461 + get_redo_offset(&action->record);
2462 length = le16_to_cpu(action->record.redo_length);
2463 target = le16_to_cpu(action->record.record_offset)
2464 + le16_to_cpu(action->record.attribute_offset);
2488 data = ((const char*)&action->record)
2489 + get_redo_offset(&action->record);
2490 length = le16_to_cpu(action->record.redo_length);
2491 resize = length - le16_to_cpu(action->record.undo_length);
2492 target = le16_to_cpu(action->record.record_offset)
2493 + le16_to_cpu(action->record.attribute_offset);
2495 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2497 (long long)inode_number(&action->record),
2501 printf("-> existing record :\n");
2506 + le16_to_cpu(action->record.record_offset));
2533 /* Resize the mft record */
2540 printf("-> new record :\n");
2545 &action->record,
2550 printf("-> MFT record %s\n",
2573 end = le32_to_cpu(action->record.client_data_length)
2575 length = le16_to_cpu(action->record.redo_length);
2576 redo = get_redo_offset(&action->record);
2580 data = ((const char*)&action->record) + redo;
2581 oldlength = le16_to_cpu(action->record.undo_length);
2582 target = le16_to_cpu(action->record.record_offset)
2583 + le16_to_cpu(action->record.attribute_offset);
2586 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2589 (long long)inode_number(&action->record),
2593 printf("-> existing record :\n");
2597 changed = (action->record.undo_operation
2604 printf("-> new record :\n");
2607 err = write_protected(vol, &action->record,
2611 printf("-> MFT record %s\n",
2638 data = ((const char*)&action->record)
2639 + get_redo_offset(&action->record);
2640 expected = ((const char*)&action->record)
2641 + get_undo_offset(&action->record);
2642 length = le16_to_cpu(action->record.redo_length);
2644 target = le16_to_cpu(action->record.record_offset)
2645 + le16_to_cpu(action->record.attribute_offset)
2648 if (action->record.undo_operation
2670 data = ((const char*)&action->record)
2671 + get_redo_offset(&action->record);
2672 expected = ((const char*)&action->record)
2673 + get_undo_offset(&action->record);
2674 length = le16_to_cpu(action->record.redo_length);
2676 target = le16_to_cpu(action->record.record_offset)
2677 + le16_to_cpu(action->record.attribute_offset);
2703 length = le16_to_cpu(action->record.redo_length);
2704 redo = get_redo_offset(&action->record);
2705 end = le32_to_cpu(action->record.client_data_length)
2711 data = ((const char*)&action->record) + redo;
2712 target = le16_to_cpu(action->record.record_offset)
2713 + le16_to_cpu(action->record.attribute_offset);
2714 count = le16_to_cpu(action->record.lcns_to_follow);
2716 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2721 printf("-> existing record :\n");
2738 printf("-> new record :\n");
2741 err = write_raw(vol, &action->record, buffer);
2744 printf("-> data record %s\n",
2763 data = ((const char*)&action->record)
2764 + get_redo_offset(&action->record);
2765 length = le16_to_cpu(action->record.redo_length);
2767 target = le16_to_cpu(action->record.record_offset)
2768 + le16_to_cpu(action->record.attribute_offset);
2792 end = le32_to_cpu(action->record.client_data_length)
2794 length = le16_to_cpu(action->record.redo_length);
2795 redo = get_redo_offset(&action->record);
2799 data = ((const char*)&action->record) + redo;
2800 oldlength = le16_to_cpu(action->record.undo_length);
2801 target = le16_to_cpu(action->record.record_offset)
2802 + le16_to_cpu(action->record.attribute_offset);
2805 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2808 (long long)inode_number(&action->record),
2812 printf("-> existing record :\n");
2821 printf("-> new record :\n");
2824 err = write_protected(vol, &action->record,
2828 printf("-> MFT record %s\n",
2858 data = ((const char*)&action->record)
2859 + get_redo_offset(&action->record);
2860 length = le16_to_cpu(action->record.redo_length);
2862 target = le16_to_cpu(action->record.record_offset)
2863 + le16_to_cpu(action->record.attribute_offset);
2865 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2871 if (action->record.record_offset) {
2894 err = write_protected(vol, &action->record,
2898 printf("-> INDX record %s\n",
2920 data = ((const char*)&action->record)
2921 + get_redo_offset(&action->record);
2922 length = le16_to_cpu(action->record.redo_length);
2923 target = le16_to_cpu(action->record.record_offset)
2924 + le16_to_cpu(action->record.attribute_offset);
2926 printf("* Ignored action-37, inode %lld record :\n",
2927 (long long)inode_number(&action->record));
2948 data = ((const char*)&action->record)
2949 + get_redo_offset(&action->record);
2950 length = le16_to_cpu(action->record.redo_length);
2951 target = le16_to_cpu(action->record.record_offset)
2952 + le16_to_cpu(action->record.attribute_offset);
2954 lcn = sle64_to_cpu(action->record.lcn_list[0]);
2960 + le16_to_cpu(action->record.record_offset));
2962 printf("-> existing record :\n");
2979 err = write_protected(vol, &action->record,
2983 printf("full record :\n");
2987 printf("-> INDX record %s\n",
3010 data = ((const char*)&action->record)
3011 + get_redo_offset(&action->record);
3012 length = le16_to_cpu(action->record.redo_length);
3013 target = le16_to_cpu(action->record.record_offset)
3014 + le16_to_cpu(action->record.attribute_offset);
3016 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3018 (long long)inode_number(&action->record),
3023 + le16_to_cpu(action->record.record_offset));
3036 if (found && !older_record(entry, &action->record)) {
3046 err = write_protected(vol, &action->record,
3050 printf("-> MFT record %s\n",
3068 data = ((const char*)&action->record)
3069 + get_redo_offset(&action->record);
3070 length = le16_to_cpu(action->record.redo_length);
3071 target = le16_to_cpu(action->record.record_offset)
3072 + le16_to_cpu(action->record.attribute_offset);
3073 if (!action->record.undo_length)
3090 data = ((const char*)&action->record)
3091 + get_undo_offset(&action->record);
3092 length = le16_to_cpu(action->record.undo_length);
3093 target = le16_to_cpu(action->record.record_offset)
3094 + le16_to_cpu(action->record.attribute_offset);
3095 if (!action->record.redo_length)
3118 data = ((const char*)&action->record)
3119 + get_undo_offset(&action->record);
3120 length = le16_to_cpu(action->record.undo_length);
3121 target = le16_to_cpu(action->record.record_offset)
3122 + le16_to_cpu(action->record.attribute_offset);
3124 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3130 + le16_to_cpu(action->record.record_offset));
3132 printf("-> existing record :\n");
3152 printf("-> inserted record :\n");
3157 err = write_protected(vol, &action->record,
3161 printf("-> INDX record %s\n",
3184 data = ((const char*)&action->record)
3185 + get_undo_offset(&action->record);
3186 length = le16_to_cpu(action->record.undo_length);
3187 target = le16_to_cpu(action->record.record_offset)
3188 + le16_to_cpu(action->record.attribute_offset);
3190 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3192 (long long)inode_number(&action->record),
3197 + le16_to_cpu(action->record.record_offset));
3230 err = write_protected(vol, &action->record,
3234 printf("-> MFT record %s\n",
3246 MFT_RECORD *record;
3256 data = ((const char*)&action->record)
3257 + get_redo_offset(&action->record);
3258 length = le16_to_cpu(action->record.redo_length);
3259 target = le16_to_cpu(action->record.record_offset)
3260 + le16_to_cpu(action->record.attribute_offset);
3262 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3264 (long long)inode_number(&action->record),
3267 record = (MFT_RECORD*)buffer;
3269 printf("-> existing record :\n");
3275 if (changed || (record->flags & MFT_RECORD_IN_USE)) {
3277 record->flags &= ~MFT_RECORD_IN_USE;
3279 printf("-> new record :\n");
3282 err = write_protected(vol, &action->record,
3286 printf("-> MFT record %s\n",
3298 MFT_RECORD *record;
3307 data = ((const char*)&action->record)
3308 + get_undo_offset(&action->record);
3309 length = le16_to_cpu(action->record.undo_length);
3310 target = le16_to_cpu(action->record.record_offset)
3311 + le16_to_cpu(action->record.attribute_offset);
3313 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3315 (long long)inode_number(&action->record),
3319 printf("-> existing record :\n");
3322 record = (MFT_RECORD*)buffer;
3325 || !(record->flags & MFT_RECORD_IN_USE);
3338 * the record now appears to not be in use and there are
3341 if (record->link_count
3342 && !(record->flags & MFT_RECORD_IN_USE))
3344 record->flags |= MFT_RECORD_IN_USE;
3346 printf("-> new record :\n");
3351 &action->record,
3355 printf("-> MFT record %s\n",
3377 (((const char*)&action->record)
3378 + get_redo_offset(&action->record));
3381 if (action->record.redo_operation
3389 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3395 if (!write_raw(vol, &action->record, buffer)) {
3398 printf("-> record updated\n");
3422 data = ((const char*)&action->record)
3423 + get_redo_offset(&action->record);
3424 length = le16_to_cpu(action->record.redo_length);
3425 extra = get_extra_offset(&action->record);
3426 if (action->record.undo_length) {
3427 name = ((const char*)&action->record) + extra;
3428 namelen = le32_to_cpu(action->record.client_data_length)
3441 pa = getattrentry(le16_to_cpu(action->record.target_attribute),0);
3489 data = ((const char*)&action->record)
3490 + get_undo_offset(&action->record);
3491 length = le16_to_cpu(action->record.undo_length);
3492 target = le16_to_cpu(action->record.record_offset)
3493 + le16_to_cpu(action->record.attribute_offset)
3501 offs = le16_to_cpu(action->record.record_offset);
3526 data = ((const char*)&action->record)
3527 + get_undo_offset(&action->record);
3528 length = le16_to_cpu(action->record.undo_length);
3530 target = le16_to_cpu(action->record.record_offset)
3531 + le16_to_cpu(action->record.attribute_offset)
3550 data = ((const char*)&action->record)
3551 + get_undo_offset(&action->record);
3552 length = le16_to_cpu(action->record.undo_length);
3553 target = le16_to_cpu(action->record.record_offset)
3554 + le16_to_cpu(action->record.attribute_offset);
3556 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3561 printf("-> existing record :\n");
3570 printf("-> new record :\n");
3573 err = write_protected(vol, &action->record, buffer,
3577 printf("-> data record %s\n",
3595 data = ((const char*)&action->record)
3596 + get_undo_offset(&action->record);
3597 length = le16_to_cpu(action->record.undo_length);
3599 target = le16_to_cpu(action->record.record_offset)
3600 + le16_to_cpu(action->record.attribute_offset);
3627 data = ((const char*)&action->record)
3628 + get_undo_offset(&action->record);
3629 length = le16_to_cpu(action->record.undo_length);
3630 resize = length - le16_to_cpu(action->record.redo_length);
3631 target = le16_to_cpu(action->record.record_offset)
3632 + le16_to_cpu(action->record.attribute_offset);
3634 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3636 (long long)inode_number(&action->record),
3641 printf("-> existing record :\n");
3646 + le16_to_cpu(action->record.record_offset));
3673 /* Resize the mft record */
3680 printf("-> new record :\n");
3685 &action->record, buffer,
3690 printf("-> MFT record %s\n",
3713 end = le32_to_cpu(action->record.client_data_length)
3715 length = le16_to_cpu(action->record.undo_length);
3716 undo = get_undo_offset(&action->record);
3720 data = ((const char*)&action->record) + undo;
3721 oldlength = le16_to_cpu(action->record.redo_length);
3722 target = le16_to_cpu(action->record.record_offset)
3723 + le16_to_cpu(action->record.attribute_offset);
3726 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3728 (long long)inode_number(&action->record),
3732 printf("-> existing record :\n");
3741 printf("-> new record :\n");
3744 err = write_protected(vol, &action->record,
3748 printf("-> MFT record %s\n",
3775 data = ((const char*)&action->record)
3776 + get_undo_offset(&action->record);
3777 expected = ((const char*)&action->record)
3778 + get_redo_offset(&action->record);
3779 length = le16_to_cpu(action->record.undo_length);
3781 target = le16_to_cpu(action->record.record_offset)
3782 + le16_to_cpu(action->record.attribute_offset)
3802 data = ((const char*)&action->record)
3803 + get_undo_offset(&action->record);
3804 expected = ((const char*)&action->record)
3805 + get_redo_offset(&action->record);
3806 length = le16_to_cpu(action->record.undo_length);
3808 target = le16_to_cpu(action->record.record_offset)
3809 + le16_to_cpu(action->record.attribute_offset);
3832 data = ((const char*)&action->record)
3833 + get_undo_offset(&action->record);
3834 length = le16_to_cpu(action->record.undo_length);
3835 target = le16_to_cpu(action->record.record_offset)
3836 + le16_to_cpu(action->record.attribute_offset);
3837 count = le16_to_cpu(action->record.lcns_to_follow);
3839 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3845 printf("-> existing record :\n");
3854 printf("-> new record :\n");
3857 err = write_raw(vol, &action->record, buffer);
3860 printf("-> data record %s\n",
3867 * data even overflows from record.
3894 end = le32_to_cpu(action->record.client_data_length)
3896 length = le16_to_cpu(action->record.undo_length);
3897 undo = get_undo_offset(&action->record);
3901 data = ((const char*)&action->record) + undo;
3902 oldlength = le16_to_cpu(action->record.redo_length);
3903 target = le16_to_cpu(action->record.record_offset)
3904 + le16_to_cpu(action->record.attribute_offset);
3907 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3910 (long long)inode_number(&action->record),
3914 printf("-> existing record :\n");
3923 printf("-> new record :\n");
3926 err = write_protected(vol, &action->record,
3930 printf("-> MFT record %s\n",
3961 end = le32_to_cpu(action->record.client_data_length)
3963 length = le16_to_cpu(action->record.undo_length);
3964 undo = get_undo_offset(&action->record);
3968 data = ((const char*)&action->record) + undo;
3969 oldlength = le16_to_cpu(action->record.redo_length);
3970 target = le16_to_cpu(action->record.record_offset)
3971 + le16_to_cpu(action->record.attribute_offset);
3974 lcn = sle64_to_cpu(action->record.lcn_list[0]);
3977 (long long)inode_number(&action->record),
3981 printf("-> existing record :\n");
3990 printf("-> new record :\n");
3993 err = write_protected(vol, &action->record,
3997 printf("-> MFT record %s\n",
4025 if (action->record.log_record_flags
4027 if (action->record.attribute_flags & ACTS_ON_INDX)
4030 if (action->record.attribute_flags & ACTS_ON_MFT)
4040 action->record.target_attribute),0);
4044 * we can sometimes tell the record does not apply
4051 data = (const char*)&action->record
4052 + get_redo_offset(&action->record);
4053 if (action->record.record_offset
4054 || (!action->record.attribute_offset
4055 && (le16_to_cpu(action->record.redo_length)
4064 action->record.target_attribute));
4103 rop = le16_to_cpu(action->record.redo_operation);
4104 uop = le16_to_cpu(action->record.undo_operation);
4107 if (action->record.undo_operation
4112 if (action->record.undo_operation
4117 if ((action->record.undo_operation
4119 || (action->record.undo_operation
4124 if (action->record.undo_operation
4129 if ((action->record.undo_operation
4131 || (action->record.undo_operation
4136 if ((action->record.undo_operation
4138 || (action->record.undo_operation
4143 if ((action->record.undo_operation
4145 || (action->record.undo_operation
4150 if ((action->record.undo_operation
4152 || (action->record.undo_operation
4157 if ((action->record.undo_operation
4159 || (action->record.undo_operation
4164 if (action->record.undo_operation
4169 if (action->record.undo_operation
4174 if (action->record.undo_operation
4179 if ((action->record.undo_operation
4181 || (action->record.undo_operation
4186 if (action->record.undo_operation
4191 if ((action->record.undo_operation
4193 || (action->record.undo_operation
4198 if ((action->record.undo_operation
4200 || (action->record.undo_operation
4205 if ((action->record.undo_operation
4207 || (action->record.undo_operation
4212 if (action->record.undo_operation
4230 if ((action->record.undo_operation
4232 || (action->record.undo_operation
4237 if (action->record.undo_operation
4242 if (action->record.undo_operation
4247 if ((action->record.undo_operation
4249 || (action->record.undo_operation
4274 * The record the action acts on is read and, when it is an MFT or
4277 * When this is an action which creates a new MFT or INDX record
4298 rop = le16_to_cpu(action->record.redo_operation);
4299 uop = le16_to_cpu(action->record.undo_operation);
4300 this_lsn = sle64_to_cpu(action->record.this_lsn);
4306 action->record.this_lsn));
4382 if (!(action->record.attribute_flags & ACTS_ON_MFT))
4388 buffer = read_protected(vol, &action->record,
4404 /* Old record not needed */
4423 if (!(action->record.attribute_flags & ACTS_ON_INDX))
4430 buffer = read_protected(vol, &action->record,
4446 /* Old record not needed */
4463 if (action->record.attribute_flags
4470 buffer = read_raw(vol, &action->record);
4511 if ((!optc || within_lcn_range(&action->record))
4527 rop = le16_to_cpu(action->record.redo_operation);
4528 uop = le16_to_cpu(action->record.undo_operation);
4531 if (action->record.undo_operation
4536 if (action->record.undo_operation
4541 if (action->record.undo_operation
4546 if (action->record.undo_operation
4551 if (action->record.undo_operation
4556 if (action->record.undo_operation
4561 if (action->record.undo_operation
4566 if (action->record.undo_operation
4571 if (action->record.undo_operation
4576 if (action->record.undo_operation
4581 if (action->record.undo_operation
4586 if (action->record.undo_operation
4591 if (action->record.undo_operation
4596 if (action->record.undo_operation
4601 if (action->record.undo_operation
4606 if (action->record.undo_operation
4611 if (action->record.undo_operation
4629 if (action->record.undo_operation
4634 if (action->record.undo_operation
4639 if (action->record.undo_operation
4644 if (action->record.undo_operation
4669 * The record the action acts on is read and, when it is an MFT or
4686 rop = le16_to_cpu(action->record.redo_operation);
4687 uop = le16_to_cpu(action->record.undo_operation);
4693 action->record.this_lsn));
4764 if (!(action->record.attribute_flags & ACTS_ON_MFT))
4767 buffer = read_protected(vol, &action->record, mftrecsz, TRUE);
4772 &action->record);
4777 printf("record lsn 0x%llx is %s than action %d lsn 0x%llx\n",
4781 (long long)sle64_to_cpu(action->record.this_lsn));
4789 * Could not read the MFT record :
4790 * if this is undoing a record create (from scratch)
4803 if (!(action->record.attribute_flags & ACTS_ON_INDX))
4807 buffer = read_protected(vol, &action->record, xsize, TRUE);
4812 &action->record);
4821 (long long)sle64_to_cpu(action->record.this_lsn));
4829 * Could not read the INDX record :
4830 * if this is undoing a record create (from scratch)
4853 if (action->record.attribute_flags
4859 buffer = read_raw(vol, &action->record);
4883 * For structured record, a check is made on the lsn to only
4885 * identifying actions on a structured record.
4898 if (!optc || within_lcn_range(&action->record))