Lines Matching refs:xs

260 				  struct ocfs2_xattr_search *xs);
265 struct ocfs2_xattr_search *xs);
273 struct ocfs2_xattr_search *xs,
278 struct ocfs2_xattr_search *xs,
1063 struct ocfs2_xattr_search *xs) in ocfs2_xattr_find_entry() argument
1073 entry = xs->here; in ocfs2_xattr_find_entry()
1074 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_find_entry()
1079 cmp = memcmp(name, (xs->base + in ocfs2_xattr_find_entry()
1086 xs->here = entry; in ocfs2_xattr_find_entry()
1148 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_get() argument
1151 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_get()
1159 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_get()
1160 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_get()
1161 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_get()
1162 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_get()
1163 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_get()
1165 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_get()
1168 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_ibody_get()
1172 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_ibody_get()
1173 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_ibody_get()
1174 le16_to_cpu(xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1175 OCFS2_XATTR_SIZE(xs->here->xe_name_len), size); in ocfs2_xattr_ibody_get()
1178 (xs->base + le16_to_cpu( in ocfs2_xattr_ibody_get()
1179 xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1180 OCFS2_XATTR_SIZE(xs->here->xe_name_len)); in ocfs2_xattr_ibody_get()
1198 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_get() argument
1206 xs->bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_block_get()
1207 if (!xs->bucket) { in ocfs2_xattr_block_get()
1213 ret = ocfs2_xattr_block_find(inode, name_index, name, xs); in ocfs2_xattr_block_get()
1219 if (xs->not_found) { in ocfs2_xattr_block_get()
1224 xb = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_get()
1225 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_block_get()
1231 name_offset = le16_to_cpu(xs->here->xe_name_offset); in ocfs2_xattr_block_get()
1232 name_len = OCFS2_XATTR_SIZE(xs->here->xe_name_len); in ocfs2_xattr_block_get()
1233 i = xs->here - xs->header->xh_entries; in ocfs2_xattr_block_get()
1237 bucket_xh(xs->bucket), in ocfs2_xattr_block_get()
1245 xs->base = bucket_block(xs->bucket, block_off); in ocfs2_xattr_block_get()
1247 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_block_get()
1248 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_block_get()
1252 (xs->base + name_offset + name_len); in ocfs2_xattr_block_get()
1263 ocfs2_xattr_bucket_free(xs->bucket); in ocfs2_xattr_block_get()
1265 brelse(xs->xattr_bh); in ocfs2_xattr_block_get()
1266 xs->xattr_bh = NULL; in ocfs2_xattr_block_get()
2665 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_find() argument
2668 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_find()
2683 xs->xattr_bh = xs->inode_bh; in ocfs2_xattr_ibody_find()
2684 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_find()
2686 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2687 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_find()
2689 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2690 (xs->end - OCFS2_SB(inode->i_sb)->s_xattr_inline_size); in ocfs2_xattr_ibody_find()
2691 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_find()
2692 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_find()
2696 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_find()
2699 xs->not_found = ret; in ocfs2_xattr_ibody_find()
2760 struct ocfs2_xattr_search *xs, in ocfs2_xattr_ibody_set() argument
2772 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt); in ocfs2_xattr_ibody_set()
2780 ocfs2_init_dinode_xa_loc(&loc, inode, xs->inode_bh, in ocfs2_xattr_ibody_set()
2781 xs->not_found ? NULL : xs->here); in ocfs2_xattr_ibody_set()
2788 xs->here = loc.xl_entry; in ocfs2_xattr_ibody_set()
2805 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_find() argument
2807 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_block_find()
2822 xs->xattr_bh = blk_bh; in ocfs2_xattr_block_find()
2826 xs->header = &xb->xb_attrs.xb_header; in ocfs2_xattr_block_find()
2827 xs->base = (void *)xs->header; in ocfs2_xattr_block_find()
2828 xs->end = (void *)(blk_bh->b_data) + blk_bh->b_size; in ocfs2_xattr_block_find()
2829 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_find()
2831 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_block_find()
2835 name, xs); in ocfs2_xattr_block_find()
2838 xs->xattr_bh = NULL; in ocfs2_xattr_block_find()
2841 xs->not_found = ret; in ocfs2_xattr_block_find()
2943 struct ocfs2_xattr_search *xs, in ocfs2_xattr_block_set() argument
2951 if (!xs->xattr_bh) { in ocfs2_xattr_block_set()
2952 ret = ocfs2_create_xattr_block(inode, xs->inode_bh, ctxt, in ocfs2_xattr_block_set()
2959 xs->xattr_bh = new_bh; in ocfs2_xattr_block_set()
2960 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2961 xs->header = &xblk->xb_attrs.xb_header; in ocfs2_xattr_block_set()
2962 xs->base = (void *)xs->header; in ocfs2_xattr_block_set()
2963 xs->end = (void *)xblk + inode->i_sb->s_blocksize; in ocfs2_xattr_block_set()
2964 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_set()
2966 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2969 ocfs2_init_xattr_block_xa_loc(&loc, inode, xs->xattr_bh, in ocfs2_xattr_block_set()
2970 xs->not_found ? NULL : xs->here); in ocfs2_xattr_block_set()
2974 xs->here = loc.xl_entry; in ocfs2_xattr_block_set()
2978 ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); in ocfs2_xattr_block_set()
2985 ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs, ctxt); in ocfs2_xattr_block_set()
2994 struct ocfs2_xattr_search *xs) in ocfs2_xattr_can_be_in_inode() argument
2998 size_t min_offs = xs->end - xs->base; in ocfs2_xattr_can_be_in_inode()
3000 if (!xs->header) in ocfs2_xattr_can_be_in_inode()
3003 last = xs->header->xh_entries; in ocfs2_xattr_can_be_in_inode()
3005 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_can_be_in_inode()
3012 free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; in ocfs2_xattr_can_be_in_inode()
3016 BUG_ON(!xs->not_found); in ocfs2_xattr_can_be_in_inode()
3808 struct ocfs2_xattr_search *xs) in ocfs2_xattr_bucket_find() argument
3891 ret = ocfs2_read_xattr_bucket(xs->bucket, lower_blkno); in ocfs2_xattr_bucket_find()
3897 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_bucket_find()
3898 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_bucket_find()
3899 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_bucket_find()
3902 xs->here = &xs->header->xh_entries[index]; in ocfs2_xattr_bucket_find()
3905 (unsigned long long)bucket_blkno(xs->bucket), in ocfs2_xattr_bucket_find()
3919 struct ocfs2_xattr_search *xs) in ocfs2_xattr_index_block_find() argument
3953 p_blkno, first_hash, num_clusters, xs); in ocfs2_xattr_index_block_find()
4247 struct ocfs2_xattr_search *xs, in ocfs2_xattr_update_xattr_search() argument
4255 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_update_xattr_search()
4256 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_update_xattr_search()
4257 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_update_xattr_search()
4259 if (xs->not_found) in ocfs2_xattr_update_xattr_search()
4262 i = xs->here - old_xh->xh_entries; in ocfs2_xattr_update_xattr_search()
4263 xs->here = &xs->header->xh_entries[i]; in ocfs2_xattr_update_xattr_search()
4267 struct ocfs2_xattr_search *xs, in ocfs2_xattr_create_index_block() argument
4275 struct buffer_head *xb_bh = xs->xattr_bh; in ocfs2_xattr_create_index_block()
4285 BUG_ON(!xs->bucket); in ocfs2_xattr_create_index_block()
4317 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno, 1); in ocfs2_xattr_create_index_block()
4323 ret = ocfs2_xattr_bucket_journal_access(handle, xs->bucket, in ocfs2_xattr_create_index_block()
4330 ocfs2_cp_xattr_block_to_bucket(inode, xb_bh, xs->bucket); in ocfs2_xattr_create_index_block()
4331 ocfs2_xattr_bucket_journal_dirty(handle, xs->bucket); in ocfs2_xattr_create_index_block()
4333 ocfs2_xattr_update_xattr_search(inode, xs, xb_bh); in ocfs2_xattr_create_index_block()
5540 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_bucket() argument
5548 ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, in ocfs2_xattr_set_entry_bucket()
5549 xs->not_found ? NULL : xs->here); in ocfs2_xattr_set_entry_bucket()
5552 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5562 xs->bucket); in ocfs2_xattr_set_entry_bucket()
5570 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5583 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_index_block() argument
5590 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()
5607 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5615 xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5616 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5630 ocfs2_xattr_bucket_relse(xs->bucket); in ocfs2_xattr_set_entry_index_block()
5631 ret = ocfs2_xattr_index_block_find(inode, xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5633 xi->xi_name, xs); in ocfs2_xattr_set_entry_index_block()
5636 xs->not_found = ret; in ocfs2_xattr_set_entry_index_block()
5639 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()