Lines Matching refs:xs
252 struct ocfs2_xattr_search *xs);
257 struct ocfs2_xattr_search *xs);
265 struct ocfs2_xattr_search *xs,
270 struct ocfs2_xattr_search *xs,
1073 struct ocfs2_xattr_search *xs) in ocfs2_xattr_find_entry() argument
1083 entry = xs->here; in ocfs2_xattr_find_entry()
1084 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_find_entry()
1089 cmp = memcmp(name, (xs->base + in ocfs2_xattr_find_entry()
1096 xs->here = entry; in ocfs2_xattr_find_entry()
1158 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_get() argument
1161 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_get()
1169 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_get()
1170 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_get()
1171 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_get()
1172 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_get()
1173 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_get()
1175 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_get()
1178 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_ibody_get()
1182 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_ibody_get()
1183 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_ibody_get()
1184 le16_to_cpu(xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1185 OCFS2_XATTR_SIZE(xs->here->xe_name_len), size); in ocfs2_xattr_ibody_get()
1188 (xs->base + le16_to_cpu( in ocfs2_xattr_ibody_get()
1189 xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1190 OCFS2_XATTR_SIZE(xs->here->xe_name_len)); in ocfs2_xattr_ibody_get()
1208 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_get() argument
1216 xs->bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_block_get()
1217 if (!xs->bucket) { in ocfs2_xattr_block_get()
1223 ret = ocfs2_xattr_block_find(inode, name_index, name, xs); in ocfs2_xattr_block_get()
1229 if (xs->not_found) { in ocfs2_xattr_block_get()
1234 xb = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_get()
1235 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_block_get()
1241 name_offset = le16_to_cpu(xs->here->xe_name_offset); in ocfs2_xattr_block_get()
1242 name_len = OCFS2_XATTR_SIZE(xs->here->xe_name_len); in ocfs2_xattr_block_get()
1243 i = xs->here - xs->header->xh_entries; in ocfs2_xattr_block_get()
1247 bucket_xh(xs->bucket), in ocfs2_xattr_block_get()
1255 xs->base = bucket_block(xs->bucket, block_off); in ocfs2_xattr_block_get()
1257 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_block_get()
1258 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_block_get()
1262 (xs->base + name_offset + name_len); in ocfs2_xattr_block_get()
1273 ocfs2_xattr_bucket_free(xs->bucket); in ocfs2_xattr_block_get()
1275 brelse(xs->xattr_bh); in ocfs2_xattr_block_get()
1276 xs->xattr_bh = NULL; in ocfs2_xattr_block_get()
2676 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_find() argument
2679 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_find()
2694 xs->xattr_bh = xs->inode_bh; in ocfs2_xattr_ibody_find()
2695 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_find()
2697 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2698 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_find()
2700 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2701 (xs->end - OCFS2_SB(inode->i_sb)->s_xattr_inline_size); in ocfs2_xattr_ibody_find()
2702 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_find()
2703 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_find()
2707 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_find()
2710 xs->not_found = ret; in ocfs2_xattr_ibody_find()
2771 struct ocfs2_xattr_search *xs, in ocfs2_xattr_ibody_set() argument
2783 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt); in ocfs2_xattr_ibody_set()
2791 ocfs2_init_dinode_xa_loc(&loc, inode, xs->inode_bh, in ocfs2_xattr_ibody_set()
2792 xs->not_found ? NULL : xs->here); in ocfs2_xattr_ibody_set()
2799 xs->here = loc.xl_entry; in ocfs2_xattr_ibody_set()
2816 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_find() argument
2818 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_block_find()
2833 xs->xattr_bh = blk_bh; in ocfs2_xattr_block_find()
2837 xs->header = &xb->xb_attrs.xb_header; in ocfs2_xattr_block_find()
2838 xs->base = (void *)xs->header; in ocfs2_xattr_block_find()
2839 xs->end = (void *)(blk_bh->b_data) + blk_bh->b_size; in ocfs2_xattr_block_find()
2840 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_find()
2842 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_block_find()
2846 name, xs); in ocfs2_xattr_block_find()
2849 xs->xattr_bh = NULL; in ocfs2_xattr_block_find()
2852 xs->not_found = ret; in ocfs2_xattr_block_find()
2954 struct ocfs2_xattr_search *xs, in ocfs2_xattr_block_set() argument
2962 if (!xs->xattr_bh) { in ocfs2_xattr_block_set()
2963 ret = ocfs2_create_xattr_block(inode, xs->inode_bh, ctxt, in ocfs2_xattr_block_set()
2970 xs->xattr_bh = new_bh; in ocfs2_xattr_block_set()
2971 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2972 xs->header = &xblk->xb_attrs.xb_header; in ocfs2_xattr_block_set()
2973 xs->base = (void *)xs->header; in ocfs2_xattr_block_set()
2974 xs->end = (void *)xblk + inode->i_sb->s_blocksize; in ocfs2_xattr_block_set()
2975 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_set()
2977 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2980 ocfs2_init_xattr_block_xa_loc(&loc, inode, xs->xattr_bh, in ocfs2_xattr_block_set()
2981 xs->not_found ? NULL : xs->here); in ocfs2_xattr_block_set()
2985 xs->here = loc.xl_entry; in ocfs2_xattr_block_set()
2989 ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); in ocfs2_xattr_block_set()
2996 ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs, ctxt); in ocfs2_xattr_block_set()
3005 struct ocfs2_xattr_search *xs) in ocfs2_xattr_can_be_in_inode() argument
3009 size_t min_offs = xs->end - xs->base; in ocfs2_xattr_can_be_in_inode()
3011 if (!xs->header) in ocfs2_xattr_can_be_in_inode()
3014 last = xs->header->xh_entries; in ocfs2_xattr_can_be_in_inode()
3016 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_can_be_in_inode()
3023 free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; in ocfs2_xattr_can_be_in_inode()
3027 BUG_ON(!xs->not_found); in ocfs2_xattr_can_be_in_inode()
3819 struct ocfs2_xattr_search *xs) in ocfs2_xattr_bucket_find() argument
3899 ret = ocfs2_read_xattr_bucket(xs->bucket, lower_blkno); in ocfs2_xattr_bucket_find()
3905 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_bucket_find()
3906 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_bucket_find()
3907 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_bucket_find()
3910 xs->here = &xs->header->xh_entries[index]; in ocfs2_xattr_bucket_find()
3913 (unsigned long long)bucket_blkno(xs->bucket), in ocfs2_xattr_bucket_find()
3927 struct ocfs2_xattr_search *xs) in ocfs2_xattr_index_block_find() argument
3961 p_blkno, first_hash, num_clusters, xs); in ocfs2_xattr_index_block_find()
4253 struct ocfs2_xattr_search *xs, in ocfs2_xattr_update_xattr_search() argument
4261 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_update_xattr_search()
4262 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_update_xattr_search()
4263 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_update_xattr_search()
4265 if (xs->not_found) in ocfs2_xattr_update_xattr_search()
4268 i = xs->here - old_xh->xh_entries; in ocfs2_xattr_update_xattr_search()
4269 xs->here = &xs->header->xh_entries[i]; in ocfs2_xattr_update_xattr_search()
4273 struct ocfs2_xattr_search *xs, in ocfs2_xattr_create_index_block() argument
4281 struct buffer_head *xb_bh = xs->xattr_bh; in ocfs2_xattr_create_index_block()
4291 BUG_ON(!xs->bucket); in ocfs2_xattr_create_index_block()
4323 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno, 1); in ocfs2_xattr_create_index_block()
4329 ret = ocfs2_xattr_bucket_journal_access(handle, xs->bucket, in ocfs2_xattr_create_index_block()
4336 ocfs2_cp_xattr_block_to_bucket(inode, xb_bh, xs->bucket); in ocfs2_xattr_create_index_block()
4337 ocfs2_xattr_bucket_journal_dirty(handle, xs->bucket); in ocfs2_xattr_create_index_block()
4339 ocfs2_xattr_update_xattr_search(inode, xs, xb_bh); in ocfs2_xattr_create_index_block()
5546 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_bucket() argument
5554 ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, in ocfs2_xattr_set_entry_bucket()
5555 xs->not_found ? NULL : xs->here); in ocfs2_xattr_set_entry_bucket()
5558 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5568 xs->bucket); in ocfs2_xattr_set_entry_bucket()
5576 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5589 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_index_block() argument
5596 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()
5613 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5621 xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5622 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5636 ocfs2_xattr_bucket_relse(xs->bucket); in ocfs2_xattr_set_entry_index_block()
5637 ret = ocfs2_xattr_index_block_find(inode, xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5639 xi->xi_name, xs); in ocfs2_xattr_set_entry_index_block()
5642 xs->not_found = ret; in ocfs2_xattr_set_entry_index_block()
5645 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()