Lines Matching refs:a
90 ATTR_RECORD *a; in ntfs_map_runlist_nolock() local
117 a = ctx->attr; in ntfs_map_runlist_nolock()
118 BUG_ON(!a->non_resident); in ntfs_map_runlist_nolock()
120 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn); in ntfs_map_runlist_nolock()
125 if (!a->data.non_resident.lowest_vcn && end_vcn <= 0) in ntfs_map_runlist_nolock()
134 if (vcn >= allocated_size_vcn || (a->type == ni->type && in ntfs_map_runlist_nolock()
135 a->name_length == ni->name_len && in ntfs_map_runlist_nolock()
136 !memcmp((u8*)a + le16_to_cpu(a->name_offset), in ntfs_map_runlist_nolock()
138 sle64_to_cpu(a->data.non_resident.lowest_vcn) in ntfs_map_runlist_nolock()
175 a = ctx->attr; in ntfs_map_runlist_nolock()
182 end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1; in ntfs_map_runlist_nolock()
187 rl = ntfs_mapping_pairs_decompress(ni->vol, a, ni->runlist.rl); in ntfs_map_runlist_nolock()
593 ATTR_RECORD *a; in ntfs_attr_find() local
603 a = ctx->attr; in ntfs_attr_find()
606 a = (ATTR_RECORD*)((u8*)ctx->attr + in ntfs_attr_find()
608 for (;; a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) { in ntfs_attr_find()
609 if ((u8*)a < (u8*)ctx->mrec || (u8*)a > (u8*)ctx->mrec + in ntfs_attr_find()
612 ctx->attr = a; in ntfs_attr_find()
613 if (unlikely(le32_to_cpu(a->type) > le32_to_cpu(type) || in ntfs_attr_find()
614 a->type == AT_END)) in ntfs_attr_find()
616 if (unlikely(!a->length)) in ntfs_attr_find()
618 if (a->type != type) in ntfs_attr_find()
626 if (a->name_length) in ntfs_attr_find()
629 (ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)), in ntfs_attr_find()
630 a->name_length, ic, upcase, upcase_len)) { in ntfs_attr_find()
634 (ntfschar*)((u8*)a + in ntfs_attr_find()
635 le16_to_cpu(a->name_offset)), in ntfs_attr_find()
636 a->name_length, 1, IGNORE_CASE, in ntfs_attr_find()
648 (ntfschar*)((u8*)a + in ntfs_attr_find()
649 le16_to_cpu(a->name_offset)), in ntfs_attr_find()
650 a->name_length, 1, CASE_SENSITIVE, in ntfs_attr_find()
668 rc = memcmp(val, (u8*)a + le16_to_cpu( in ntfs_attr_find()
669 a->data.resident.value_offset), in ntfs_attr_find()
671 a->data.resident.value_length))); in ntfs_attr_find()
680 a->data.resident.value_length); in ntfs_attr_find()
866 ATTR_RECORD *a; in ntfs_external_attr_find() local
1039 a = ctx->attr; in ntfs_external_attr_find()
1045 if ((u8*)a < (u8*)ctx->mrec || (u8*)a > (u8*)ctx->mrec + in ntfs_external_attr_find()
1048 if (a->type == AT_END) in ntfs_external_attr_find()
1050 if (!a->length) in ntfs_external_attr_find()
1052 if (al_entry->instance != a->instance) in ntfs_external_attr_find()
1059 if (al_entry->type != a->type) in ntfs_external_attr_find()
1061 if (!ntfs_are_names_equal((ntfschar*)((u8*)a + in ntfs_external_attr_find()
1062 le16_to_cpu(a->name_offset)), a->name_length, in ntfs_external_attr_find()
1066 ctx->attr = a; in ntfs_external_attr_find()
1071 if (!val || (!a->non_resident && le32_to_cpu( in ntfs_external_attr_find()
1072 a->data.resident.value_length) == val_len && in ntfs_external_attr_find()
1073 !memcmp((u8*)a + in ntfs_external_attr_find()
1074 le16_to_cpu(a->data.resident.value_offset), in ntfs_external_attr_find()
1081 a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length)); in ntfs_external_attr_find()
1435 int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size) in ntfs_attr_record_resize() argument
1442 if (new_size != le32_to_cpu(a->length)) { in ntfs_attr_record_resize()
1444 le32_to_cpu(a->length) + new_size; in ntfs_attr_record_resize()
1449 memmove((u8*)a + new_size, (u8*)a + le32_to_cpu(a->length), in ntfs_attr_record_resize()
1450 le32_to_cpu(m->bytes_in_use) - ((u8*)a - in ntfs_attr_record_resize()
1451 (u8*)m) - le32_to_cpu(a->length)); in ntfs_attr_record_resize()
1455 if (new_size >= offsetof(ATTR_REC, length) + sizeof(a->length)) in ntfs_attr_record_resize()
1456 a->length = cpu_to_le32(new_size); in ntfs_attr_record_resize()
1479 int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, in ntfs_resident_attr_value_resize() argument
1485 if (ntfs_attr_record_resize(m, a, in ntfs_resident_attr_value_resize()
1486 le16_to_cpu(a->data.resident.value_offset) + new_size)) in ntfs_resident_attr_value_resize()
1492 old_size = le32_to_cpu(a->data.resident.value_length); in ntfs_resident_attr_value_resize()
1494 memset((u8*)a + le16_to_cpu(a->data.resident.value_offset) + in ntfs_resident_attr_value_resize()
1497 a->data.resident.value_length = cpu_to_le32(new_size); in ntfs_resident_attr_value_resize()
1542 ATTR_RECORD *a; in ntfs_attr_make_non_resident() local
1632 a = ctx->attr; in ntfs_attr_make_non_resident()
1634 BUG_ON(a->non_resident); in ntfs_attr_make_non_resident()
1641 sizeof(a->data.non_resident.compressed_size) + in ntfs_attr_make_non_resident()
1646 mp_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; in ntfs_attr_make_non_resident()
1656 attr_size = le32_to_cpu(a->data.resident.value_length); in ntfs_attr_make_non_resident()
1660 memcpy(kaddr, (u8*)a + in ntfs_attr_make_non_resident()
1661 le16_to_cpu(a->data.resident.value_offset), in ntfs_attr_make_non_resident()
1669 old_res_attr_flags = a->data.resident.flags; in ntfs_attr_make_non_resident()
1671 err = ntfs_attr_record_resize(m, a, arec_size); in ntfs_attr_make_non_resident()
1678 a->non_resident = 1; in ntfs_attr_make_non_resident()
1680 if (a->name_length) in ntfs_attr_make_non_resident()
1681 memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), in ntfs_attr_make_non_resident()
1682 a->name_length * sizeof(ntfschar)); in ntfs_attr_make_non_resident()
1683 a->name_offset = cpu_to_le16(name_ofs); in ntfs_attr_make_non_resident()
1685 a->data.non_resident.lowest_vcn = 0; in ntfs_attr_make_non_resident()
1686 a->data.non_resident.highest_vcn = cpu_to_sle64((new_size - 1) >> in ntfs_attr_make_non_resident()
1688 a->data.non_resident.mapping_pairs_offset = cpu_to_le16(mp_ofs); in ntfs_attr_make_non_resident()
1689 memset(&a->data.non_resident.reserved, 0, in ntfs_attr_make_non_resident()
1690 sizeof(a->data.non_resident.reserved)); in ntfs_attr_make_non_resident()
1691 a->data.non_resident.allocated_size = cpu_to_sle64(new_size); in ntfs_attr_make_non_resident()
1692 a->data.non_resident.data_size = in ntfs_attr_make_non_resident()
1693 a->data.non_resident.initialized_size = in ntfs_attr_make_non_resident()
1696 a->data.non_resident.compression_unit = 0; in ntfs_attr_make_non_resident()
1698 a->data.non_resident.compression_unit = 4; in ntfs_attr_make_non_resident()
1699 a->data.non_resident.compressed_size = in ntfs_attr_make_non_resident()
1700 a->data.non_resident.allocated_size; in ntfs_attr_make_non_resident()
1702 a->data.non_resident.compression_unit = 0; in ntfs_attr_make_non_resident()
1704 err = ntfs_mapping_pairs_build(vol, (u8*)a + mp_ofs, in ntfs_attr_make_non_resident()
1717 if (a->data.non_resident.compression_unit) { in ntfs_attr_make_non_resident()
1718 ni->itype.compressed.block_size = 1U << (a->data. in ntfs_attr_make_non_resident()
1725 a->data.non_resident.compression_unit; in ntfs_attr_make_non_resident()
1757 a->non_resident = 0; in ntfs_attr_make_non_resident()
1760 sizeof(a->data.resident.reserved) + 7) & ~7; in ntfs_attr_make_non_resident()
1761 if (a->name_length) in ntfs_attr_make_non_resident()
1762 memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), in ntfs_attr_make_non_resident()
1763 a->name_length * sizeof(ntfschar)); in ntfs_attr_make_non_resident()
1764 mp_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; in ntfs_attr_make_non_resident()
1765 a->name_offset = cpu_to_le16(name_ofs); in ntfs_attr_make_non_resident()
1768 err2 = ntfs_attr_record_resize(m, a, arec_size); in ntfs_attr_make_non_resident()
1778 arec_size = le32_to_cpu(a->length); in ntfs_attr_make_non_resident()
1801 a->data.resident.value_length = cpu_to_le32(attr_size); in ntfs_attr_make_non_resident()
1802 a->data.resident.value_offset = cpu_to_le16(mp_ofs); in ntfs_attr_make_non_resident()
1803 a->data.resident.flags = old_res_attr_flags; in ntfs_attr_make_non_resident()
1804 memset(&a->data.resident.reserved, 0, in ntfs_attr_make_non_resident()
1805 sizeof(a->data.resident.reserved)); in ntfs_attr_make_non_resident()
1809 memcpy((u8*)a + mp_ofs, kaddr, attr_size); in ntfs_attr_make_non_resident()
1913 ATTR_RECORD *a; in ntfs_attr_extend_allocation() local
2038 a = ctx->attr; in ntfs_attr_extend_allocation()
2040 if (a->non_resident) in ntfs_attr_extend_allocation()
2044 attr_len = le32_to_cpu(a->data.resident.value_length); in ntfs_attr_extend_allocation()
2051 !ntfs_attr_record_resize(m, a, in ntfs_attr_extend_allocation()
2052 le16_to_cpu(a->data.resident.value_offset) + in ntfs_attr_extend_allocation()
2056 ni->allocated_size = le32_to_cpu(a->length) - in ntfs_attr_extend_allocation()
2057 le16_to_cpu(a->data.resident.value_offset); in ntfs_attr_extend_allocation()
2061 a->data.resident.value_length = in ntfs_attr_extend_allocation()
2184 rl = ntfs_mapping_pairs_decompress(vol, a, ni->runlist.rl); in ntfs_attr_extend_allocation()
2260 ll = sle64_to_cpu(a->data.non_resident.lowest_vcn); in ntfs_attr_extend_allocation()
2281 attr_len = le32_to_cpu(a->length); in ntfs_attr_extend_allocation()
2282 err = ntfs_attr_record_resize(m, a, mp_size + in ntfs_attr_extend_allocation()
2283 le16_to_cpu(a->data.non_resident.mapping_pairs_offset)); in ntfs_attr_extend_allocation()
2302 err = ntfs_mapping_pairs_build(vol, (u8*)a + in ntfs_attr_extend_allocation()
2303 le16_to_cpu(a->data.non_resident.mapping_pairs_offset), in ntfs_attr_extend_allocation()
2316 a->data.non_resident.highest_vcn = cpu_to_sle64((new_alloc_size >> in ntfs_attr_extend_allocation()
2322 if (a->data.non_resident.lowest_vcn) { in ntfs_attr_extend_allocation()
2335 a = ctx->attr; in ntfs_attr_extend_allocation()
2339 a->data.non_resident.allocated_size = cpu_to_sle64(new_alloc_size); in ntfs_attr_extend_allocation()
2352 a->data.non_resident.compressed_size = in ntfs_attr_extend_allocation()
2361 sle64_to_cpu(a->data.non_resident.data_size)); in ntfs_attr_extend_allocation()
2362 a->data.non_resident.data_size = cpu_to_sle64(new_data_size); in ntfs_attr_extend_allocation()
2426 a = ctx->attr; in ntfs_attr_extend_allocation()
2440 if (ntfs_attr_record_resize(m, a, attr_len)) { in ntfs_attr_extend_allocation()
2446 if (ntfs_mapping_pairs_build(vol, (u8*)a + le16_to_cpu( in ntfs_attr_extend_allocation()
2447 a->data.non_resident. in ntfs_attr_extend_allocation()
2449 le16_to_cpu(a->data.non_resident. in ntfs_attr_extend_allocation()