Lines Matching full:ea

24 static inline size_t unpacked_ea_size(const struct EA_FULL *ea)  in unpacked_ea_size()  argument
26 return ea->size ? le32_to_cpu(ea->size) : in unpacked_ea_size()
27 ALIGN(struct_size(ea, name, in unpacked_ea_size()
28 1 + ea->name_len + in unpacked_ea_size()
29 le16_to_cpu(ea->elength)), in unpacked_ea_size()
33 static inline size_t packed_ea_size(const struct EA_FULL *ea) in packed_ea_size() argument
35 return struct_size(ea, name, in packed_ea_size()
36 1 + ea->name_len + le16_to_cpu(ea->elength)) - in packed_ea_size()
55 const struct EA_FULL *ea = Add2Ptr(ea_all, *off); in find_ea() local
56 ea_size = unpacked_ea_size(ea); in find_ea()
57 if (ea->name_len == name_len && in find_ea()
58 !memcmp(ea->name, name, name_len)) { in find_ea()
70 * @ea: New allocated memory.
73 static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea, in ntfs_read_ea() argument
85 *ea = NULL; in ntfs_read_ea()
100 /* Check Ea limit. */ in ntfs_read_ea()
113 /* EA info persists, but xattr is empty. Looks like EA problem. */ in ntfs_read_ea()
117 /* Allocate memory for packed Ea. */ in ntfs_read_ea()
150 /* Check if we can use field ea->size. */ in ntfs_read_ea()
173 *ea = ea_p; in ntfs_read_ea()
198 const struct EA_FULL *ea; in ntfs_list_ea() local
216 ea = Add2Ptr(ea_all, off); in ntfs_list_ea()
217 ea_size = unpacked_ea_size(ea); in ntfs_list_ea()
219 if (!ea->name_len) in ntfs_list_ea()
222 if (ea->name_len > ea_size) { in ntfs_list_ea()
229 /* Check if we can use field ea->name */ in ntfs_list_ea()
233 if (ret + ea->name_len + 1 > bytes_per_buffer) { in ntfs_list_ea()
238 memcpy(buffer + ret, ea->name, ea->name_len); in ntfs_list_ea()
239 buffer[ret + ea->name_len] = 0; in ntfs_list_ea()
242 ret += ea->name_len + 1; in ntfs_list_ea()
256 const struct EA_FULL *ea; in ntfs_get_ea() local
286 ea = Add2Ptr(ea_all, off); in ntfs_get_ea()
288 len = le16_to_cpu(ea->elength); in ntfs_get_ea()
301 memcpy(buffer, ea->name + ea->name_len + 1, len); in ntfs_get_ea()
361 struct EA_FULL *ea; in ntfs_set_ea() local
368 ea = Add2Ptr(ea_all, off); in ntfs_set_ea()
374 if (val_size && le16_to_cpu(ea->elength) == val_size && in ntfs_set_ea()
375 !memcmp(ea->name + ea->name_len + 1, value, val_size)) { in ntfs_set_ea()
381 if (ea->flags & FILE_NEED_EA) in ntfs_set_ea()
384 le16_add_cpu(&ea_info.size_pack, 0 - packed_ea_size(ea)); in ntfs_set_ea()
386 memmove(ea, Add2Ptr(ea, ea_sz), size - off - ea_sz); in ntfs_set_ea()