Lines Matching refs:xattr
109 static int get_prefix(struct xattr_list *xattr, char *name) in get_prefix() argument
113 xattr->full_name = strdup(name); in get_prefix()
117 if(strncmp(xattr->full_name, p->prefix, strlen(p->prefix)) == 0) in get_prefix()
122 xattr->name = xattr->full_name + strlen(prefix_table[i].prefix); in get_prefix()
123 xattr->size = strlen(xattr->name); in get_prefix()
265 static int get_xattr_size(struct xattr_list *xattr) in get_xattr_size() argument
268 sizeof(struct squashfs_xattr_val) + xattr->size; in get_xattr_size()
270 if(xattr->type & XATTR_VALUE_OOL) in get_xattr_size()
273 size += xattr->vsize; in get_xattr_size()
336 struct xattr_list *xattr = &xattr_list[i]; in check_id_dupl() local
338 checksum = get_checksum(xattr->full_name, in check_id_dupl()
339 strlen(xattr->full_name), checksum); in check_id_dupl()
340 checksum = get_checksum(xattr->value, in check_id_dupl()
341 xattr->vsize, checksum); in check_id_dupl()
349 struct xattr_list *xattr = &xattr_list[i]; in check_id_dupl() local
352 if(strcmp(xattr->full_name, dup_xattr->full_name)) in check_id_dupl()
355 if(memcmp(xattr->value, dup_xattr->value, xattr->vsize)) in check_id_dupl()
379 static void check_value_dupl(struct xattr_list *xattr) in check_value_dupl() argument
383 if(xattr->vsize < XATTR_VALUE_OOL_SIZE) in check_value_dupl()
387 xattr->vchecksum = get_checksum(xattr->value, xattr->vsize, 0); in check_value_dupl()
388 for(entry = dupl_value[xattr->vchecksum]; entry; entry = entry->vnext) { in check_value_dupl()
389 if(entry->vsize != xattr->vsize) in check_value_dupl()
392 if(memcmp(entry->value, xattr->value, xattr->vsize) == 0) in check_value_dupl()
401 xattr->vnext = dupl_value[xattr->vchecksum]; in check_value_dupl()
402 dupl_value[xattr->vchecksum] = xattr; in check_value_dupl()
403 xattr->ool_value = SQUASHFS_INVALID_BLK; in check_value_dupl()
409 xattr->type |= XATTR_VALUE_OOL; in check_value_dupl()
410 xattr->ool_value = entry->ool_value; in check_value_dupl()
413 if(xattr->value != entry->value) { in check_value_dupl()
414 free(xattr->value); in check_value_dupl()
415 xattr->value = entry->value; in check_value_dupl()
438 xattr_id->xattr = xattr_disk; in get_xattr_id()
553 struct xattr_list *xattr = &xattr_list[i]; in generate_xattrs() local
554 xattr->type &= XATTR_PREFIX_MASK; /* all inline */ in generate_xattrs()
555 if (xattr->vsize > xattr_value_max) in generate_xattrs()
556 xattr->type |= XATTR_VALUE_OOL; in generate_xattrs()
558 total_size += get_xattr_size(xattr); in generate_xattrs()
592 struct xattr_list *xattr = &xattr_list[i]; in generate_xattrs() local
594 if((xattr->type & XATTR_VALUE_OOL) && in generate_xattrs()
595 (xattr->ool_value == SQUASHFS_INVALID_BLK)) { in generate_xattrs()
597 int size = sizeof(val) + xattr->vsize; in generate_xattrs()
598 xp = get_xattr_space(size, &xattr->ool_value); in generate_xattrs()
599 val.vsize = xattr->vsize; in generate_xattrs()
601 memcpy(xp + sizeof(val), xattr->value, xattr->vsize); in generate_xattrs()
610 struct xattr_list *xattr = &xattr_list[i]; in generate_xattrs() local
614 xp = get_xattr_space(sizeof(entry) + xattr->size, NULL); in generate_xattrs()
615 entry.type = xattr->type; in generate_xattrs()
616 entry.size = xattr->size; in generate_xattrs()
618 memcpy(xp + sizeof(entry), xattr->name, xattr->size); in generate_xattrs()
620 if(xattr->type & XATTR_VALUE_OOL) { in generate_xattrs()
625 SQUASHFS_SWAP_LONG_LONGS(&xattr->ool_value, xp + in generate_xattrs()
628 int size = sizeof(val) + xattr->vsize; in generate_xattrs()
629 xp = get_xattr_space(size, &xattr->ool_value); in generate_xattrs()
630 val.vsize = xattr->vsize; in generate_xattrs()
632 memcpy(xp + sizeof(val), xattr->value, xattr->vsize); in generate_xattrs()