Lines Matching refs:header
139 ext2_xattr_header_valid(struct ext2_xattr_header *header) in ext2_xattr_header_valid() argument
141 if (header->h_magic != cpu_to_le32(EXT2_XATTR_MAGIC) || in ext2_xattr_header_valid()
142 header->h_blocks != cpu_to_le32(1)) in ext2_xattr_header_valid()
412 struct ext2_xattr_header *header = NULL; in ext2_xattr_set() local
450 header = HDR(bh); in ext2_xattr_set()
452 if (!ext2_xattr_header_valid(header)) { in ext2_xattr_set()
487 free = min_offs - ((char*)last - (char*)header) - sizeof(__u32); in ext2_xattr_set()
516 if (header) { in ext2_xattr_set()
519 if (header->h_refcount == cpu_to_le32(1)) { in ext2_xattr_set()
520 __u32 hash = le32_to_cpu(header->h_hash); in ext2_xattr_set()
536 header = kmemdup(HDR(bh), bh->b_size, GFP_KERNEL); in ext2_xattr_set()
538 if (header == NULL) in ext2_xattr_set()
540 header->h_refcount = cpu_to_le32(1); in ext2_xattr_set()
543 here = ENTRY((char *)header + offset); in ext2_xattr_set()
545 last = ENTRY((char *)header + offset); in ext2_xattr_set()
549 header = kzalloc(sb->s_blocksize, GFP_KERNEL); in ext2_xattr_set()
551 if (header == NULL) in ext2_xattr_set()
553 end = (char *)header + sb->s_blocksize; in ext2_xattr_set()
554 header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC); in ext2_xattr_set()
555 header->h_blocks = header->h_refcount = cpu_to_le32(1); in ext2_xattr_set()
556 last = here = ENTRY(header+1); in ext2_xattr_set()
572 char *first_val = (char *)header + min_offs; in ext2_xattr_set()
574 char *val = (char *)header + offs; in ext2_xattr_set()
595 last = ENTRY(header+1); in ext2_xattr_set()
619 char *val = (char *)header + min_offs - size; in ext2_xattr_set()
621 cpu_to_le16((char *)val - (char *)header); in ext2_xattr_set()
629 if (IS_LAST_ENTRY(ENTRY(header+1))) { in ext2_xattr_set()
631 if (bh && header == HDR(bh)) in ext2_xattr_set()
635 ext2_xattr_rehash(header, here); in ext2_xattr_set()
636 if (bh && header == HDR(bh)) in ext2_xattr_set()
638 error = ext2_xattr_set2(inode, bh, header); in ext2_xattr_set()
642 if (!(bh && header == HDR(bh))) in ext2_xattr_set()
643 kfree(header); in ext2_xattr_set()
655 struct ext2_xattr_header *header) in ext2_xattr_set2() argument
662 if (header) { in ext2_xattr_set2()
663 new_bh = ext2_xattr_cache_find(inode, header); in ext2_xattr_set2()
683 } else if (old_bh && header == HDR(old_bh)) { in ext2_xattr_set2()
706 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()