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,
1057 struct ocfs2_xattr_search *xs) in ocfs2_xattr_find_entry() argument
1067 entry = xs->here; in ocfs2_xattr_find_entry()
1068 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_find_entry()
1073 cmp = memcmp(name, (xs->base + in ocfs2_xattr_find_entry()
1080 xs->here = entry; in ocfs2_xattr_find_entry()
1142 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_get() argument
1145 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_get()
1153 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_get()
1154 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_get()
1155 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_get()
1156 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_get()
1157 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_get()
1159 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_get()
1162 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_ibody_get()
1166 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_ibody_get()
1167 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_ibody_get()
1168 le16_to_cpu(xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1169 OCFS2_XATTR_SIZE(xs->here->xe_name_len), size); in ocfs2_xattr_ibody_get()
1172 (xs->base + le16_to_cpu( in ocfs2_xattr_ibody_get()
1173 xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1174 OCFS2_XATTR_SIZE(xs->here->xe_name_len)); in ocfs2_xattr_ibody_get()
1192 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_get() argument
1200 xs->bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_block_get()
1201 if (!xs->bucket) { in ocfs2_xattr_block_get()
1207 ret = ocfs2_xattr_block_find(inode, name_index, name, xs); in ocfs2_xattr_block_get()
1213 if (xs->not_found) { in ocfs2_xattr_block_get()
1218 xb = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_get()
1219 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_block_get()
1225 name_offset = le16_to_cpu(xs->here->xe_name_offset); in ocfs2_xattr_block_get()
1226 name_len = OCFS2_XATTR_SIZE(xs->here->xe_name_len); in ocfs2_xattr_block_get()
1227 i = xs->here - xs->header->xh_entries; in ocfs2_xattr_block_get()
1231 bucket_xh(xs->bucket), in ocfs2_xattr_block_get()
1239 xs->base = bucket_block(xs->bucket, block_off); in ocfs2_xattr_block_get()
1241 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_block_get()
1242 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_block_get()
1246 (xs->base + name_offset + name_len); in ocfs2_xattr_block_get()
1257 ocfs2_xattr_bucket_free(xs->bucket); in ocfs2_xattr_block_get()
1259 brelse(xs->xattr_bh); in ocfs2_xattr_block_get()
1260 xs->xattr_bh = NULL; in ocfs2_xattr_block_get()
2659 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_find() argument
2662 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_find()
2677 xs->xattr_bh = xs->inode_bh; in ocfs2_xattr_ibody_find()
2678 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_find()
2680 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2681 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_find()
2683 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2684 (xs->end - OCFS2_SB(inode->i_sb)->s_xattr_inline_size); in ocfs2_xattr_ibody_find()
2685 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_find()
2686 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_find()
2690 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_find()
2693 xs->not_found = ret; in ocfs2_xattr_ibody_find()
2754 struct ocfs2_xattr_search *xs, in ocfs2_xattr_ibody_set() argument
2766 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt); in ocfs2_xattr_ibody_set()
2774 ocfs2_init_dinode_xa_loc(&loc, inode, xs->inode_bh, in ocfs2_xattr_ibody_set()
2775 xs->not_found ? NULL : xs->here); in ocfs2_xattr_ibody_set()
2782 xs->here = loc.xl_entry; in ocfs2_xattr_ibody_set()
2799 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_find() argument
2801 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_block_find()
2816 xs->xattr_bh = blk_bh; in ocfs2_xattr_block_find()
2820 xs->header = &xb->xb_attrs.xb_header; in ocfs2_xattr_block_find()
2821 xs->base = (void *)xs->header; in ocfs2_xattr_block_find()
2822 xs->end = (void *)(blk_bh->b_data) + blk_bh->b_size; in ocfs2_xattr_block_find()
2823 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_find()
2825 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_block_find()
2829 name, xs); in ocfs2_xattr_block_find()
2832 xs->xattr_bh = NULL; in ocfs2_xattr_block_find()
2835 xs->not_found = ret; in ocfs2_xattr_block_find()
2937 struct ocfs2_xattr_search *xs, in ocfs2_xattr_block_set() argument
2945 if (!xs->xattr_bh) { in ocfs2_xattr_block_set()
2946 ret = ocfs2_create_xattr_block(inode, xs->inode_bh, ctxt, in ocfs2_xattr_block_set()
2953 xs->xattr_bh = new_bh; in ocfs2_xattr_block_set()
2954 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2955 xs->header = &xblk->xb_attrs.xb_header; in ocfs2_xattr_block_set()
2956 xs->base = (void *)xs->header; in ocfs2_xattr_block_set()
2957 xs->end = (void *)xblk + inode->i_sb->s_blocksize; in ocfs2_xattr_block_set()
2958 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_set()
2960 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2963 ocfs2_init_xattr_block_xa_loc(&loc, inode, xs->xattr_bh, in ocfs2_xattr_block_set()
2964 xs->not_found ? NULL : xs->here); in ocfs2_xattr_block_set()
2968 xs->here = loc.xl_entry; in ocfs2_xattr_block_set()
2972 ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); in ocfs2_xattr_block_set()
2979 ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs, ctxt); in ocfs2_xattr_block_set()
2988 struct ocfs2_xattr_search *xs) in ocfs2_xattr_can_be_in_inode() argument
2992 size_t min_offs = xs->end - xs->base; in ocfs2_xattr_can_be_in_inode()
2994 if (!xs->header) in ocfs2_xattr_can_be_in_inode()
2997 last = xs->header->xh_entries; in ocfs2_xattr_can_be_in_inode()
2999 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_can_be_in_inode()
3006 free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; in ocfs2_xattr_can_be_in_inode()
3010 BUG_ON(!xs->not_found); in ocfs2_xattr_can_be_in_inode()
3800 struct ocfs2_xattr_search *xs) in ocfs2_xattr_bucket_find() argument
3883 ret = ocfs2_read_xattr_bucket(xs->bucket, lower_blkno); in ocfs2_xattr_bucket_find()
3889 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_bucket_find()
3890 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_bucket_find()
3891 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_bucket_find()
3894 xs->here = &xs->header->xh_entries[index]; in ocfs2_xattr_bucket_find()
3897 (unsigned long long)bucket_blkno(xs->bucket), in ocfs2_xattr_bucket_find()
3911 struct ocfs2_xattr_search *xs) in ocfs2_xattr_index_block_find() argument
3945 p_blkno, first_hash, num_clusters, xs); in ocfs2_xattr_index_block_find()
4239 struct ocfs2_xattr_search *xs, in ocfs2_xattr_update_xattr_search() argument
4247 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_update_xattr_search()
4248 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_update_xattr_search()
4249 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_update_xattr_search()
4251 if (xs->not_found) in ocfs2_xattr_update_xattr_search()
4254 i = xs->here - old_xh->xh_entries; in ocfs2_xattr_update_xattr_search()
4255 xs->here = &xs->header->xh_entries[i]; in ocfs2_xattr_update_xattr_search()
4259 struct ocfs2_xattr_search *xs, in ocfs2_xattr_create_index_block() argument
4267 struct buffer_head *xb_bh = xs->xattr_bh; in ocfs2_xattr_create_index_block()
4277 BUG_ON(!xs->bucket); in ocfs2_xattr_create_index_block()
4309 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno, 1); in ocfs2_xattr_create_index_block()
4315 ret = ocfs2_xattr_bucket_journal_access(handle, xs->bucket, in ocfs2_xattr_create_index_block()
4322 ocfs2_cp_xattr_block_to_bucket(inode, xb_bh, xs->bucket); in ocfs2_xattr_create_index_block()
4323 ocfs2_xattr_bucket_journal_dirty(handle, xs->bucket); in ocfs2_xattr_create_index_block()
4325 ocfs2_xattr_update_xattr_search(inode, xs, xb_bh); in ocfs2_xattr_create_index_block()
5532 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_bucket() argument
5540 ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, in ocfs2_xattr_set_entry_bucket()
5541 xs->not_found ? NULL : xs->here); in ocfs2_xattr_set_entry_bucket()
5544 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5554 xs->bucket); in ocfs2_xattr_set_entry_bucket()
5562 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5575 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_index_block() argument
5582 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()
5599 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5607 xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5608 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5622 ocfs2_xattr_bucket_relse(xs->bucket); in ocfs2_xattr_set_entry_index_block()
5623 ret = ocfs2_xattr_index_block_find(inode, xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5625 xi->xi_name, xs); in ocfs2_xattr_set_entry_index_block()
5628 xs->not_found = ret; in ocfs2_xattr_set_entry_index_block()
5631 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()