Lines Matching refs:ea

95 static inline int name_size(struct jfs_ea *ea)  in name_size()  argument
97 if (is_known_namespace(ea->name)) in name_size()
98 return ea->namelen; in name_size()
100 return ea->namelen + XATTR_OS2_PREFIX_LEN; in name_size()
103 static inline int copy_name(char *buffer, struct jfs_ea *ea) in copy_name() argument
105 int len = ea->namelen; in copy_name()
107 if (!is_known_namespace(ea->name)) { in copy_name()
112 memcpy(buffer, ea->name, ea->namelen); in copy_name()
113 buffer[ea->namelen] = 0; in copy_name()
144 int size, dxd_t * ea) in ea_write_inline() argument
159 if (!(ji->mode2 & INLINEEA) && !(ji->ea.flag & DXD_INLINE)) in ea_write_inline()
162 DXDsize(ea, size); in ea_write_inline()
163 DXDlength(ea, 0); in ea_write_inline()
164 DXDaddress(ea, 0); in ea_write_inline()
166 ea->flag = DXD_INLINE; in ea_write_inline()
169 ea->flag = 0; in ea_write_inline()
170 DXDsize(ea, 0); in ea_write_inline()
171 DXDlength(ea, 0); in ea_write_inline()
172 DXDaddress(ea, 0); in ea_write_inline()
175 if (ji->ea.flag & DXD_INLINE) in ea_write_inline()
202 dxd_t * ea) in ea_write() argument
220 if (!ea_write_inline(ip, ealist, size, ea)) in ea_write()
287 ea->flag = DXD_EXTENT; in ea_write()
288 DXDsize(ea, le32_to_cpu(ealist->size)); in ea_write()
289 DXDlength(ea, nblocks); in ea_write()
290 DXDaddress(ea, blkno); in ea_write()
293 if (ji->ea.flag & DXD_INLINE) in ea_write()
320 int ea_size = sizeDXD(&ji->ea); in ea_read_inline()
328 if ((sizeDXD(&ji->ea) > sizeof (ji->i_inline_ea))) in ea_read_inline()
365 if (ji->ea.flag & DXD_INLINE) in ea_read()
368 nbytes = sizeDXD(&ji->ea); in ea_read()
378 nblocks = lengthDXD(&ji->ea) << sbi->l2nbperpage; in ea_read()
379 blkno = addressDXD(&ji->ea) << sbi->l2nbperpage; in ea_read()
431 int ea_size = sizeDXD(&ji->ea); in ea_get()
438 if (ji->ea.flag == 0) in ea_get()
460 } else if (ji->ea.flag & DXD_INLINE) { in ea_get()
469 if (!(ji->ea.flag & DXD_EXTENT)) { in ea_get()
547 ea_buf->mp = read_metapage(inode, addressDXD(&ji->ea), in ea_get()
548 lengthDXD(&ji->ea) << sb->s_blocksize_bits, in ea_get()
625 if (ji->ea.flag & DXD_EXTENT) { in ea_put()
626 invalidate_dxd_metapages(inode, ji->ea); in ea_put()
627 old_blocks = lengthDXD(&ji->ea); in ea_put()
631 txEA(tid, inode, &ji->ea, &ea_buf->new_ea); in ea_put()
634 if (ji->ea.flag & DXD_INLINE) in ea_put()
637 ji->ea = ea_buf->new_ea; in ea_put()
639 txEA(tid, inode, &ji->ea, NULL); in ea_put()
640 if (ji->ea.flag & DXD_INLINE) in ea_put()
642 ji->ea.flag = 0; in ea_put()
643 ji->ea.size = 0; in ea_put()
659 struct jfs_ea *ea, *old_ea = NULL, *next_ea = NULL; in __jfs_setxattr() local
682 for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); in __jfs_setxattr()
683 ea = NEXT_EA(ea)) { in __jfs_setxattr()
684 if ((namelen == ea->namelen) && in __jfs_setxattr()
685 (memcmp(name, ea->name, namelen) == 0)) { in __jfs_setxattr()
691 old_ea = ea; in __jfs_setxattr()
692 old_ea_size = EA_SIZE(ea); in __jfs_setxattr()
693 next_ea = NEXT_EA(ea); in __jfs_setxattr()
695 new_size += EA_SIZE(ea); in __jfs_setxattr()
754 ea = (struct jfs_ea *) ((char *) ealist + xattr_size); in __jfs_setxattr()
755 ea->flag = 0; in __jfs_setxattr()
756 ea->namelen = namelen; in __jfs_setxattr()
757 ea->valuelen = (cpu_to_le16(value_len)); in __jfs_setxattr()
758 memcpy(ea->name, name, namelen); in __jfs_setxattr()
759 ea->name[namelen] = 0; in __jfs_setxattr()
761 memcpy(&ea->name[namelen + 1], value, value_len); in __jfs_setxattr()
762 xattr_size += EA_SIZE(ea); in __jfs_setxattr()
798 struct jfs_ea *ea; in __jfs_getxattr() local
820 for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) in __jfs_getxattr()
821 if ((namelen == ea->namelen) && in __jfs_getxattr()
822 memcmp(name, ea->name, namelen) == 0) { in __jfs_getxattr()
824 size = le16_to_cpu(ea->valuelen); in __jfs_getxattr()
831 value = ((char *) &ea->name) + ea->namelen + 1; in __jfs_getxattr()
848 static inline int can_list(struct jfs_ea *ea) in can_list() argument
850 return (strncmp(ea->name, XATTR_TRUSTED_PREFIX, in can_list()
862 struct jfs_ea *ea; in jfs_listxattr() local
879 for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) { in jfs_listxattr()
880 if (can_list(ea)) in jfs_listxattr()
881 size += name_size(ea) + 1; in jfs_listxattr()
894 for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist); ea = NEXT_EA(ea)) { in jfs_listxattr()
895 if (can_list(ea)) { in jfs_listxattr()
896 int namelen = copy_name(buffer, ea); in jfs_listxattr()