/third_party/ntfs-3g/libntfs-3g/ |
D | lcnalloc.c | 95 static void update_full_status(ntfs_volume *vol, LCN lcn) in update_full_status() argument 97 if (lcn >= vol->mft_zone_end) { in update_full_status() 99 ntfs_cluster_update_zone_pos(vol, ZONE_DATA1, lcn); in update_full_status() 103 if (lcn < vol->mft_zone_start) { in update_full_status() 105 ntfs_cluster_update_zone_pos(vol, ZONE_DATA2, lcn); in update_full_status() 110 ntfs_cluster_update_zone_pos(vol, ZONE_MFT, lcn); in update_full_status() 239 LCN last_read_pos, lcn; in ntfs_cluster_alloc() local 269 rl[0].lcn = LCN_RL_NOT_MAPPED; in ntfs_cluster_alloc() 334 lcn = bmp_pos & 7; in ntfs_cluster_alloc() 338 while (lcn < buf_size) { in ntfs_cluster_alloc() [all …]
|
D | runlist.c | 171 if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED)) in ntfs_rl_are_mergeable() 177 if ((dst->lcn >= 0) && (src->lcn >= 0) && in ntfs_rl_are_mergeable() 178 ((dst->lcn + dst->length) == src->lcn)) in ntfs_rl_are_mergeable() 181 if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE)) in ntfs_rl_are_mergeable() 262 if (dst[marker].lcn == LCN_ENOENT) in ntfs_rl_append() 348 if (dst[marker].lcn == LCN_HOLE || dst[marker].lcn == LCN_RL_NOT_MAPPED) in ntfs_rl_insert() 360 dst[loc].lcn = LCN_RL_NOT_MAPPED; in ntfs_rl_insert() 446 if (((dsize - tail) > 0) && (dst[marker].lcn == LCN_ENOENT)) in ntfs_rl_replace() 542 drl[0].lcn = LCN_RL_NOT_MAPPED; in ntfs_runlists_merge_i() 551 while (srl[si].length && srl[si].lcn < (LCN)LCN_HOLE) in ntfs_runlists_merge_i() [all …]
|
D | debug.c | 59 LCN lcn = (rl + i)->lcn; in ntfs_debug_runlist_dump() local 61 if (lcn < (LCN)0) { in ntfs_debug_runlist_dump() 62 int idx = -lcn - 1; in ntfs_debug_runlist_dump() 72 (long long)rl[i].vcn, (long long)rl[i].lcn, in ntfs_debug_runlist_dump()
|
D | compress.c | 664 if (rl->lcn < LCN_HOLE || !rl->length) { in ntfs_is_cb_compressed() 667 if (!rl || rl->lcn < LCN_HOLE || !rl->length) in ntfs_is_cb_compressed() 677 if (rl->lcn == LCN_HOLE) in ntfs_is_cb_compressed() 813 if (!rl || rl->lcn < LCN_HOLE) { in ntfs_compressed_attr_pread() 822 if (rl->lcn == LCN_HOLE) { in ntfs_compressed_attr_pread() 998 xpos = xrl->lcn << vol->cluster_size_bits; in read_clusters() 1039 xpos = xrl->lcn << vol->cluster_size_bits; in write_clusters() 1182 if (xrl->lcn == LCN_HOLE) { in valid_compressed_run() 1187 if (fullcheck && (xrl[1].lcn == LCN_HOLE)) { in valid_compressed_run() 1248 freelcn = rl->lcn + usedcnt; in ntfs_compress_overwr_free() [all …]
|
D | device.c | 433 s64 ntfs_cluster_read(const ntfs_volume *vol, const s64 lcn, const s64 count, in ntfs_cluster_read() argument 438 if (!vol || lcn < 0 || count < 0) { in ntfs_cluster_read() 442 if (vol->nr_clusters < lcn + count) { in ntfs_cluster_read() 446 (long long)lcn + count); in ntfs_cluster_read() 449 br = ntfs_pread(vol->dev, lcn << vol->cluster_size_bits, in ntfs_cluster_read() 469 s64 ntfs_cluster_write(const ntfs_volume *vol, const s64 lcn, in ntfs_cluster_write() argument 474 if (!vol || lcn < 0 || count < 0) { in ntfs_cluster_write() 478 if (vol->nr_clusters < lcn + count) { in ntfs_cluster_write() 482 (long long)lcn + count); in ntfs_cluster_write() 486 bw = ntfs_pwrite(vol->dev, lcn << vol->cluster_size_bits, in ntfs_cluster_write()
|
D | attrib.c | 261 rl[i].lcn << vol->cluster_size_bits, in ntfs_get_attribute_value() 297 r = ntfs_pread(vol->dev, rl[i].lcn << vol->cluster_size_bits, in ntfs_get_attribute_value() 613 LCN lcn; in ntfs_attr_map_runlist() local 619 lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn); in ntfs_attr_map_runlist() 620 if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT) in ntfs_attr_map_runlist() 880 LCN lcn; in ntfs_attr_vcn_to_lcn() local 890 lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn); in ntfs_attr_vcn_to_lcn() 891 if (lcn >= 0) in ntfs_attr_vcn_to_lcn() 892 return lcn; in ntfs_attr_vcn_to_lcn() 902 if (!is_retry || lcn == (LCN)LCN_RL_NOT_MAPPED) in ntfs_attr_vcn_to_lcn() [all …]
|
D | ioctl.c | 89 static int fstrim_clusters(ntfs_volume *vol, LCN lcn, s64 length) in fstrim_clusters() argument 95 (long long) lcn, (long long) length); in fstrim_clusters() 97 range[0] = lcn << vol->cluster_size_bits; in fstrim_clusters() 229 static inline LCN align_up(ntfs_volume *vol, LCN lcn, u64 granularity) in align_up() argument 233 aligned = (lcn << vol->cluster_size_bits) + granularity - 1; in align_up()
|
D | mft.c | 717 LCN lcn; in ntfs_mft_bitmap_extend_allocation_i() local 737 if (!rl || !rl->length || rl->lcn < 0) { in ntfs_mft_bitmap_extend_allocation_i() 744 lcn = rl->lcn + rl->length; in ntfs_mft_bitmap_extend_allocation_i() 746 rl2 = ntfs_cluster_alloc(vol, rl[1].vcn, 1, lcn, DATA_ZONE); in ntfs_mft_bitmap_extend_allocation_i() 878 lcn = rl->lcn; in ntfs_mft_bitmap_extend_allocation_i() 879 rl->lcn = rl[1].lcn; in ntfs_mft_bitmap_extend_allocation_i() 883 if (ntfs_bitmap_clear_bit(vol->lcnbmp_na, lcn)) in ntfs_mft_bitmap_extend_allocation_i() 1038 LCN lcn; in ntfs_mft_data_extend_allocation() local 1063 if (!rl || !rl->length || rl->lcn < 0) { in ntfs_mft_data_extend_allocation() 1071 lcn = rl->lcn + rl->length; in ntfs_mft_data_extend_allocation() [all …]
|
/third_party/ntfs-3g/ntfsprogs/ |
D | ntfsmove.c | 278 LCN lcn = rl->lcn; 292 if (lcn < (LCN)0) { 293 int j = -lcn - 1; 303 rl->vcn, rl->lcn, rl->length); 430 res[0].lcn = start; in find_unused() 432 res[1].lcn = LCN_ENOENT; in find_unused() 451 if (utils_cluster_in_use(vol, res->lcn + i)) { in find_unused() 453 (long long)res->lcn + i); in find_unused() 519 res = ntfs_bitmap_set_run(vol->lcnbmp_na, rl->lcn, rl->length); in bitmap_alloc() 537 res = ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn, rl->length); in bitmap_free() [all …]
|
D | ntfsresize.c | 176 s64 lcn; /* last used LCN for a "special" file/attr type */ member 663 static void rl_set(runlist *rl, VCN vcn, LCN lcn, s64 len) in rl_set() argument 666 rl->lcn = lcn; in rl_set() 683 (long long)r->lcn, (long long)r->lcn, in dump_run() 717 last_lcn = rl->lcn + (rl->length - 1); in collect_resize_constraints() 763 if (llcn->lcn < last_lcn) { in collect_resize_constraints() 764 llcn->lcn = last_lcn; in collect_resize_constraints() 778 s64 lcn, lcn_length, start, len, inode; in collect_relocation_info() local 781 lcn = rl->lcn; in collect_relocation_info() 786 if (lcn + lcn_length <= new_vol_size) in collect_relocation_info() [all …]
|
D | playlog.c | 77 LCN lcn; member 138 static struct STORE *getclusterentry(LCN lcn, BOOL create) in getclusterentry() argument 145 while (*current && (lcn != (*current)->lcn)) { in getclusterentry() 146 if (lcn > (*current)->lcn) in getclusterentry() 157 newone->lcn = lcn; in getclusterentry() 173 (long long)entry->lcn, in freeclusterentry() 429 LCN lcn; in read_raw() local 445 lcn = sle64_to_cpu(logr->lcn_list[i]); in read_raw() 448 store = getclusterentry(lcn, FALSE); in read_raw() 453 (long long)lcn); in read_raw() [all …]
|
D | ntfsclone.c | 758 static void copy_cluster(int rescue, u64 rescue_lcn, u64 lcn) argument 782 backup_bootsector = (lcn + 1)*csize >= full_device_size; 784 csize = full_device_size - lcn*csize; 813 && (!lcn || backup_bootsector)) { 820 if (!lcn) { 838 if (!lcn) 879 static void lseek_to_cluster(s64 lcn) argument 883 pos = (off_t)(lcn * vol->cluster_size); 1356 s64 offset = 0, lcn, vcn; local 1361 lcn = ntfs_rl_vcn_to_lcn(rl, vcn); [all …]
|
D | ntfscp.c | 87 s64 lcn; member 430 static int merge_run(struct ALLOC_CONTEXT *alctx, s64 lcn, s32 count) in merge_run() argument 470 alctx->rl[k].lcn = lcn; in merge_run() 490 alctx->rl[k+1].lcn = lcn; in merge_run() 524 alctx->lcn = offbuf + index; in examine_buf() 534 count = offbuf + index - alctx->lcn; in examine_buf() 537 if (merge_run(alctx, alctx->lcn, count)) { in examine_buf() 558 LCN lcn; in sort_runlist() local 570 if (alctx->rl[k+1].lcn < alctx->rl[k].lcn) { in sort_runlist() 572 lcn = alctx->rl[k].lcn; in sort_runlist() [all …]
|
D | mkntfs.c | 164 LCN lcn; /* first allocated cluster */ member 348 static BOOL bitmap_allocate(LCN lcn, s64 length) in bitmap_allocate() argument 360 while (p && (p->lcn <= lcn)) { in bitmap_allocate() 365 if ((q && ((q->lcn + q->length) > lcn)) in bitmap_allocate() 366 || (p && ((lcn + length) > p->lcn))) { in bitmap_allocate() 370 if (q && ((q->lcn + q->length) == lcn)) { in bitmap_allocate() 377 newall->lcn = lcn; in bitmap_allocate() 398 static BOOL bitmap_deallocate(LCN lcn, s64 length) in bitmap_deallocate() argument 412 first = (p->lcn > lcn ? p->lcn : lcn); in bitmap_deallocate() 413 last = ((p->lcn + p->length) < (lcn + length) in bitmap_deallocate() [all …]
|
D | ntfscluster.c | 312 if (rl[z].lcn >= 0) { in info() 411 (long long)runs[i].lcn, in dump_file() 466 if ((run->lcn + run->length) > m->lcn) { in find_last() 468 m->lcn = run->lcn + run->length; in find_last() 553 m.lcn = -1; in main() 555 if (m.lcn >= 0) { in main()
|
D | cluster.c | 92 LCN a_begin = runs[j].lcn; in cluster_find() 100 (long long)runs[j].lcn, in cluster_find() 101 (long long)(runs[j].lcn + in cluster_find()
|
D | ntfsfallocate.c | 436 brl->lcn + begin_common - brl->vcn, in free_common() 441 (long long)(brl->lcn + begin_common in free_common() 461 if (brl->lcn != LCN_HOLE) { in ntfs_restore_rl() 466 if (grl->lcn == LCN_HOLE) { in ntfs_restore_rl() 512 (rl->lcn + cofs) in ntfs_inner_zero() 614 && ((rl->lcn >= 0) in ntfs_inner_allocation() 628 if ((--prl)->lcn >= 0) { in ntfs_inner_allocation() 629 lcn_seek_from = prl->lcn in ntfs_inner_allocation()
|
D | utils.c | 727 int utils_cluster_in_use(ntfs_volume *vol, long long lcn) in utils_cluster_in_use() argument 740 if ((lcn < bmplcn) in utils_cluster_in_use() 741 || (lcn >= (long long)(bmplcn + (sizeof(buffer) << 3)))) { in utils_cluster_in_use() 751 bmplcn = lcn & (~((sizeof(buffer) << 3) - 1)); in utils_cluster_in_use() 764 bit = 1 << (lcn & 7); in utils_cluster_in_use() 765 byte = (lcn >> 3) & (sizeof(buffer) - 1); in utils_cluster_in_use() 767 "in use %d\n", lcn, bmplcn, byte, bit, buffer[byte] & in utils_cluster_in_use()
|
D | ntfsundelete.c | 1499 if (rl[0].lcn == LCN_RL_NOT_MAPPED) { /* extended mft record */ in calc_percentage() 1507 if (rl[i].lcn == LCN_RL_NOT_MAPPED) { in calc_percentage() 1515 if (rl[i].lcn == LCN_HOLE) { in calc_percentage() 1520 start = rl[i].lcn; in calc_percentage() 1521 end = rl[i].lcn + rl[i].length; in calc_percentage() 1653 (long long)d->runlist[i].lcn); in dump_record() 2085 if (rl[0].lcn == LCN_RL_NOT_MAPPED) { /* extended mft record */ in undelete_file() 2102 if (rl[i].lcn == LCN_RL_NOT_MAPPED) { in undelete_file() 2118 if (rl[i].lcn == LCN_HOLE) { in undelete_file() 2131 start = rl[i].lcn; in undelete_file() [all …]
|
D | ntfsfix.c | 845 if ((rl[0].lcn >= 0) in short_mft_selfloc_condition() 849 && (rl[1].lcn == LCN_RL_NOT_MAPPED)) { in short_mft_selfloc_condition() 895 && (rl->lcn >= 0) in attrlist_selfloc_condition() 898 rl->lcn << vol->cluster_size_bits, in attrlist_selfloc_condition() 900 selfloc->attrlist_lcn = rl->lcn; in attrlist_selfloc_condition() 984 if ((rl[0].lcn == LCN_RL_NOT_MAPPED) in self_mapped_selfloc_condition() 988 && ((u64)(rl[1].lcn << vol->cluster_size_bits) in self_mapped_selfloc_condition() 990 && ((u64)((rl[1].lcn + rl[1].length) in self_mapped_selfloc_condition()
|
D | ntfscluster.h | 55 LCN lcn; /* Last cluster in use */ member
|
D | ntfswipe.c | 667 (((rlc + 1)->length) && (rlc->lcn != LCN_HOLE))) { in wipe_compressed_attribute() 672 if (rlc->lcn == LCN_HOLE) { in wipe_compressed_attribute() 684 while ((rlt - 1)->lcn == LCN_HOLE) rlt--; in wipe_compressed_attribute() 723 if (rlc->lcn == LCN_HOLE) in wipe_compressed_attribute() 753 if (rlc->lcn == LCN_HOLE) in wipe_compressed_attribute() 1918 if (rl[i].lcn == -1) { in destroy_record() 1921 for (j = rl[i].lcn; in destroy_record() 1922 (j < rl[i].lcn + rl[i].length) in destroy_record()
|
/third_party/ntfs-3g/include/ntfs-3g/ |
D | device.h | 133 extern s64 ntfs_cluster_read(const ntfs_volume *vol, const s64 lcn, 135 extern s64 ntfs_cluster_write(const ntfs_volume *vol, const s64 lcn,
|
D | lcnalloc.h | 45 extern int ntfs_cluster_free_basic(ntfs_volume *vol, s64 lcn, s64 count);
|
D | runlist.h | 48 LCN lcn; /* lcn = Starting logical cluster number. */ member
|