Lines Matching refs:header
138 ext2_xattr_header_valid(struct ext2_xattr_header *header) in ext2_xattr_header_valid() argument
140 if (header->h_magic != cpu_to_le32(EXT2_XATTR_MAGIC) || in ext2_xattr_header_valid()
141 header->h_blocks != cpu_to_le32(1)) in ext2_xattr_header_valid()
411 struct ext2_xattr_header *header = NULL; in ext2_xattr_set() local
449 header = HDR(bh); in ext2_xattr_set()
451 if (!ext2_xattr_header_valid(header)) { in ext2_xattr_set()
486 free = min_offs - ((char*)last - (char*)header) - sizeof(__u32); in ext2_xattr_set()
515 if (header) { in ext2_xattr_set()
518 if (header->h_refcount == cpu_to_le32(1)) { in ext2_xattr_set()
519 __u32 hash = le32_to_cpu(header->h_hash); in ext2_xattr_set()
535 header = kmemdup(HDR(bh), bh->b_size, GFP_KERNEL); in ext2_xattr_set()
537 if (header == NULL) in ext2_xattr_set()
539 header->h_refcount = cpu_to_le32(1); in ext2_xattr_set()
542 here = ENTRY((char *)header + offset); in ext2_xattr_set()
544 last = ENTRY((char *)header + offset); in ext2_xattr_set()
548 header = kzalloc(sb->s_blocksize, GFP_KERNEL); in ext2_xattr_set()
550 if (header == NULL) in ext2_xattr_set()
552 end = (char *)header + sb->s_blocksize; in ext2_xattr_set()
553 header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC); in ext2_xattr_set()
554 header->h_blocks = header->h_refcount = cpu_to_le32(1); in ext2_xattr_set()
555 last = here = ENTRY(header+1); in ext2_xattr_set()
571 char *first_val = (char *)header + min_offs; in ext2_xattr_set()
573 char *val = (char *)header + offs; in ext2_xattr_set()
594 last = ENTRY(header+1); in ext2_xattr_set()
618 char *val = (char *)header + min_offs - size; in ext2_xattr_set()
620 cpu_to_le16((char *)val - (char *)header); in ext2_xattr_set()
628 if (IS_LAST_ENTRY(ENTRY(header+1))) { in ext2_xattr_set()
630 if (bh && header == HDR(bh)) in ext2_xattr_set()
634 ext2_xattr_rehash(header, here); in ext2_xattr_set()
635 if (bh && header == HDR(bh)) in ext2_xattr_set()
637 error = ext2_xattr_set2(inode, bh, header); in ext2_xattr_set()
641 if (!(bh && header == HDR(bh))) in ext2_xattr_set()
642 kfree(header); in ext2_xattr_set()
654 struct ext2_xattr_header *header) in ext2_xattr_set2() argument
661 if (header) { in ext2_xattr_set2()
662 new_bh = ext2_xattr_cache_find(inode, header); in ext2_xattr_set2()
682 } else if (old_bh && header == HDR(old_bh)) { in ext2_xattr_set2()
705 memcpy(new_bh->b_data, header, new_bh->b_size); in ext2_xattr_set2()
925 ext2_xattr_cache_find(struct inode *inode, struct ext2_xattr_header *header) in ext2_xattr_cache_find() argument
927 __u32 hash = le32_to_cpu(header->h_hash); in ext2_xattr_cache_find()
931 if (!header->h_hash) in ext2_xattr_cache_find()
966 } else if (!ext2_xattr_cmp(header, HDR(bh))) { in ext2_xattr_cache_find()
989 static inline void ext2_xattr_hash_entry(struct ext2_xattr_header *header, in ext2_xattr_hash_entry() argument
1003 __le32 *value = (__le32 *)((char *)header + in ext2_xattr_hash_entry()
1025 static void ext2_xattr_rehash(struct ext2_xattr_header *header, in ext2_xattr_rehash() argument
1031 ext2_xattr_hash_entry(header, entry); in ext2_xattr_rehash()
1032 here = ENTRY(header+1); in ext2_xattr_rehash()
1044 header->h_hash = cpu_to_le32(hash); in ext2_xattr_rehash()