Lines Matching refs:a

76 	ATTR_RECORD *a;  in ntfs_map_runlist_nolock()  local
103 a = ctx->attr; in ntfs_map_runlist_nolock()
104 BUG_ON(!a->non_resident); in ntfs_map_runlist_nolock()
106 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn); in ntfs_map_runlist_nolock()
111 if (!a->data.non_resident.lowest_vcn && end_vcn <= 0) in ntfs_map_runlist_nolock()
120 if (vcn >= allocated_size_vcn || (a->type == ni->type && in ntfs_map_runlist_nolock()
121 a->name_length == ni->name_len && in ntfs_map_runlist_nolock()
122 !memcmp((u8*)a + le16_to_cpu(a->name_offset), in ntfs_map_runlist_nolock()
124 sle64_to_cpu(a->data.non_resident.lowest_vcn) in ntfs_map_runlist_nolock()
161 a = ctx->attr; in ntfs_map_runlist_nolock()
168 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1; in ntfs_map_runlist_nolock()
173 rl = ntfs_mapping_pairs_decompress(ni->vol, a, ni->runlist.rl); in ntfs_map_runlist_nolock()
579 ATTR_RECORD *a; in ntfs_attr_find() local
589 a = ctx->attr; in ntfs_attr_find()
592 a = (ATTR_RECORD*)((u8*)ctx->attr + in ntfs_attr_find()
594 for (;; a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) { in ntfs_attr_find()
600 if ((u8 *)a < (u8 *)ctx->mrec) in ntfs_attr_find()
604 if ((u8 *)a > mrec_end || in ntfs_attr_find()
605 (u8 *)a + sizeof(ATTR_RECORD) > mrec_end) in ntfs_attr_find()
609 name_end = (u8 *)a + le16_to_cpu(a->name_offset) + in ntfs_attr_find()
610 a->name_length * sizeof(ntfschar); in ntfs_attr_find()
614 ctx->attr = a; in ntfs_attr_find()
615 if (unlikely(le32_to_cpu(a->type) > le32_to_cpu(type) || in ntfs_attr_find()
616 a->type == AT_END)) in ntfs_attr_find()
618 if (unlikely(!a->length)) in ntfs_attr_find()
622 if ((u8 *)a + le32_to_cpu(a->length) < (u8 *)a) in ntfs_attr_find()
625 if ((u8 *)a + le32_to_cpu(a->length) > mrec_end) in ntfs_attr_find()
628 if (a->type != type) in ntfs_attr_find()
636 if (a->name_length) in ntfs_attr_find()
639 (ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)), in ntfs_attr_find()
640 a->name_length, ic, upcase, upcase_len)) { in ntfs_attr_find()
644 (ntfschar*)((u8*)a + in ntfs_attr_find()
645 le16_to_cpu(a->name_offset)), in ntfs_attr_find()
646 a->name_length, 1, IGNORE_CASE, in ntfs_attr_find()
658 (ntfschar*)((u8*)a + in ntfs_attr_find()
659 le16_to_cpu(a->name_offset)), in ntfs_attr_find()
660 a->name_length, 1, CASE_SENSITIVE, in ntfs_attr_find()
678 rc = memcmp(val, (u8*)a + le16_to_cpu( in ntfs_attr_find()
679 a->data.resident.value_offset), in ntfs_attr_find()
681 a->data.resident.value_length))); in ntfs_attr_find()
690 a->data.resident.value_length); in ntfs_attr_find()
876 ATTR_RECORD *a; in ntfs_external_attr_find() local
1049 a = ctx->attr; in ntfs_external_attr_find()
1055 if ((u8*)a < (u8*)ctx->mrec || (u8*)a > (u8*)ctx->mrec + in ntfs_external_attr_find()
1058 if (a->type == AT_END) in ntfs_external_attr_find()
1060 if (!a->length) in ntfs_external_attr_find()
1062 if (al_entry->instance != a->instance) in ntfs_external_attr_find()
1069 if (al_entry->type != a->type) in ntfs_external_attr_find()
1071 if (!ntfs_are_names_equal((ntfschar*)((u8*)a + in ntfs_external_attr_find()
1072 le16_to_cpu(a->name_offset)), a->name_length, in ntfs_external_attr_find()
1076 ctx->attr = a; in ntfs_external_attr_find()
1081 if (!val || (!a->non_resident && le32_to_cpu( in ntfs_external_attr_find()
1082 a->data.resident.value_length) == val_len && in ntfs_external_attr_find()
1083 !memcmp((u8*)a + in ntfs_external_attr_find()
1084 le16_to_cpu(a->data.resident.value_offset), in ntfs_external_attr_find()
1091 a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length)); in ntfs_external_attr_find()
1445 int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size) in ntfs_attr_record_resize() argument
1452 if (new_size != le32_to_cpu(a->length)) { in ntfs_attr_record_resize()
1454 le32_to_cpu(a->length) + new_size; in ntfs_attr_record_resize()
1459 memmove((u8*)a + new_size, (u8*)a + le32_to_cpu(a->length), in ntfs_attr_record_resize()
1460 le32_to_cpu(m->bytes_in_use) - ((u8*)a - in ntfs_attr_record_resize()
1461 (u8*)m) - le32_to_cpu(a->length)); in ntfs_attr_record_resize()
1465 if (new_size >= offsetof(ATTR_REC, length) + sizeof(a->length)) in ntfs_attr_record_resize()
1466 a->length = cpu_to_le32(new_size); in ntfs_attr_record_resize()
1489 int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, in ntfs_resident_attr_value_resize() argument
1495 if (ntfs_attr_record_resize(m, a, in ntfs_resident_attr_value_resize()
1496 le16_to_cpu(a->data.resident.value_offset) + new_size)) in ntfs_resident_attr_value_resize()
1502 old_size = le32_to_cpu(a->data.resident.value_length); in ntfs_resident_attr_value_resize()
1504 memset((u8*)a + le16_to_cpu(a->data.resident.value_offset) + in ntfs_resident_attr_value_resize()
1507 a->data.resident.value_length = cpu_to_le32(new_size); in ntfs_resident_attr_value_resize()
1552 ATTR_RECORD *a; in ntfs_attr_make_non_resident() local
1642 a = ctx->attr; in ntfs_attr_make_non_resident()
1644 BUG_ON(a->non_resident); in ntfs_attr_make_non_resident()
1651 sizeof(a->data.non_resident.compressed_size) + in ntfs_attr_make_non_resident()
1656 mp_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; in ntfs_attr_make_non_resident()
1666 attr_size = le32_to_cpu(a->data.resident.value_length); in ntfs_attr_make_non_resident()
1670 memcpy(kaddr, (u8*)a + in ntfs_attr_make_non_resident()
1671 le16_to_cpu(a->data.resident.value_offset), in ntfs_attr_make_non_resident()
1679 old_res_attr_flags = a->data.resident.flags; in ntfs_attr_make_non_resident()
1681 err = ntfs_attr_record_resize(m, a, arec_size); in ntfs_attr_make_non_resident()
1688 a->non_resident = 1; in ntfs_attr_make_non_resident()
1690 if (a->name_length) in ntfs_attr_make_non_resident()
1691 memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), in ntfs_attr_make_non_resident()
1692 a->name_length * sizeof(ntfschar)); in ntfs_attr_make_non_resident()
1693 a->name_offset = cpu_to_le16(name_ofs); in ntfs_attr_make_non_resident()
1695 a->data.non_resident.lowest_vcn = 0; in ntfs_attr_make_non_resident()
1696 a->data.non_resident.highest_vcn = cpu_to_sle64((new_size - 1) >> in ntfs_attr_make_non_resident()
1698 a->data.non_resident.mapping_pairs_offset = cpu_to_le16(mp_ofs); in ntfs_attr_make_non_resident()
1699 memset(&a->data.non_resident.reserved, 0, in ntfs_attr_make_non_resident()
1700 sizeof(a->data.non_resident.reserved)); in ntfs_attr_make_non_resident()
1701 a->data.non_resident.allocated_size = cpu_to_sle64(new_size); in ntfs_attr_make_non_resident()
1702 a->data.non_resident.data_size = in ntfs_attr_make_non_resident()
1703 a->data.non_resident.initialized_size = in ntfs_attr_make_non_resident()
1706 a->data.non_resident.compression_unit = 0; in ntfs_attr_make_non_resident()
1708 a->data.non_resident.compression_unit = 4; in ntfs_attr_make_non_resident()
1709 a->data.non_resident.compressed_size = in ntfs_attr_make_non_resident()
1710 a->data.non_resident.allocated_size; in ntfs_attr_make_non_resident()
1712 a->data.non_resident.compression_unit = 0; in ntfs_attr_make_non_resident()
1714 err = ntfs_mapping_pairs_build(vol, (u8*)a + mp_ofs, in ntfs_attr_make_non_resident()
1727 if (a->data.non_resident.compression_unit) { in ntfs_attr_make_non_resident()
1728 ni->itype.compressed.block_size = 1U << (a->data. in ntfs_attr_make_non_resident()
1735 a->data.non_resident.compression_unit; in ntfs_attr_make_non_resident()
1767 a->non_resident = 0; in ntfs_attr_make_non_resident()
1770 sizeof(a->data.resident.reserved) + 7) & ~7; in ntfs_attr_make_non_resident()
1771 if (a->name_length) in ntfs_attr_make_non_resident()
1772 memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), in ntfs_attr_make_non_resident()
1773 a->name_length * sizeof(ntfschar)); in ntfs_attr_make_non_resident()
1774 mp_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; in ntfs_attr_make_non_resident()
1775 a->name_offset = cpu_to_le16(name_ofs); in ntfs_attr_make_non_resident()
1778 err2 = ntfs_attr_record_resize(m, a, arec_size); in ntfs_attr_make_non_resident()
1788 arec_size = le32_to_cpu(a->length); in ntfs_attr_make_non_resident()
1811 a->data.resident.value_length = cpu_to_le32(attr_size); in ntfs_attr_make_non_resident()
1812 a->data.resident.value_offset = cpu_to_le16(mp_ofs); in ntfs_attr_make_non_resident()
1813 a->data.resident.flags = old_res_attr_flags; in ntfs_attr_make_non_resident()
1814 memset(&a->data.resident.reserved, 0, in ntfs_attr_make_non_resident()
1815 sizeof(a->data.resident.reserved)); in ntfs_attr_make_non_resident()
1819 memcpy((u8*)a + mp_ofs, kaddr, attr_size); in ntfs_attr_make_non_resident()
1923 ATTR_RECORD *a; in ntfs_attr_extend_allocation() local
2048 a = ctx->attr; in ntfs_attr_extend_allocation()
2050 if (a->non_resident) in ntfs_attr_extend_allocation()
2054 attr_len = le32_to_cpu(a->data.resident.value_length); in ntfs_attr_extend_allocation()
2061 !ntfs_attr_record_resize(m, a, in ntfs_attr_extend_allocation()
2062 le16_to_cpu(a->data.resident.value_offset) + in ntfs_attr_extend_allocation()
2066 ni->allocated_size = le32_to_cpu(a->length) - in ntfs_attr_extend_allocation()
2067 le16_to_cpu(a->data.resident.value_offset); in ntfs_attr_extend_allocation()
2071 a->data.resident.value_length = in ntfs_attr_extend_allocation()
2194 rl = ntfs_mapping_pairs_decompress(vol, a, ni->runlist.rl); in ntfs_attr_extend_allocation()
2270 ll = sle64_to_cpu(a->data.non_resident.lowest_vcn); in ntfs_attr_extend_allocation()
2291 attr_len = le32_to_cpu(a->length); in ntfs_attr_extend_allocation()
2292 err = ntfs_attr_record_resize(m, a, mp_size + in ntfs_attr_extend_allocation()
2293 le16_to_cpu(a->data.non_resident.mapping_pairs_offset)); in ntfs_attr_extend_allocation()
2312 err = ntfs_mapping_pairs_build(vol, (u8*)a + in ntfs_attr_extend_allocation()
2313 le16_to_cpu(a->data.non_resident.mapping_pairs_offset), in ntfs_attr_extend_allocation()
2326 a->data.non_resident.highest_vcn = cpu_to_sle64((new_alloc_size >> in ntfs_attr_extend_allocation()
2332 if (a->data.non_resident.lowest_vcn) { in ntfs_attr_extend_allocation()
2345 a = ctx->attr; in ntfs_attr_extend_allocation()
2349 a->data.non_resident.allocated_size = cpu_to_sle64(new_alloc_size); in ntfs_attr_extend_allocation()
2362 a->data.non_resident.compressed_size = in ntfs_attr_extend_allocation()
2371 sle64_to_cpu(a->data.non_resident.data_size)); in ntfs_attr_extend_allocation()
2372 a->data.non_resident.data_size = cpu_to_sle64(new_data_size); in ntfs_attr_extend_allocation()
2436 a = ctx->attr; in ntfs_attr_extend_allocation()
2450 if (ntfs_attr_record_resize(m, a, attr_len)) { in ntfs_attr_extend_allocation()
2456 if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu( in ntfs_attr_extend_allocation()
2457 a->data.non_resident. in ntfs_attr_extend_allocation()
2459 le16_to_cpu(a->data.non_resident. in ntfs_attr_extend_allocation()