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,
1081 struct ocfs2_xattr_search *xs) in ocfs2_xattr_find_entry() argument
1091 entry = xs->here; in ocfs2_xattr_find_entry()
1092 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_find_entry()
1097 cmp = memcmp(name, (xs->base + in ocfs2_xattr_find_entry()
1104 xs->here = entry; in ocfs2_xattr_find_entry()
1166 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_get() argument
1169 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_get()
1177 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_get()
1178 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_get()
1179 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_get()
1180 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_get()
1181 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_get()
1183 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_get()
1186 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_ibody_get()
1190 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_ibody_get()
1191 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_ibody_get()
1192 le16_to_cpu(xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1193 OCFS2_XATTR_SIZE(xs->here->xe_name_len), size); in ocfs2_xattr_ibody_get()
1196 (xs->base + le16_to_cpu( in ocfs2_xattr_ibody_get()
1197 xs->here->xe_name_offset) + in ocfs2_xattr_ibody_get()
1198 OCFS2_XATTR_SIZE(xs->here->xe_name_len)); in ocfs2_xattr_ibody_get()
1216 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_get() argument
1224 xs->bucket = ocfs2_xattr_bucket_new(inode); in ocfs2_xattr_block_get()
1225 if (!xs->bucket) { in ocfs2_xattr_block_get()
1231 ret = ocfs2_xattr_block_find(inode, name_index, name, xs); in ocfs2_xattr_block_get()
1237 if (xs->not_found) { in ocfs2_xattr_block_get()
1242 xb = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_get()
1243 size = le64_to_cpu(xs->here->xe_value_size); in ocfs2_xattr_block_get()
1249 name_offset = le16_to_cpu(xs->here->xe_name_offset); in ocfs2_xattr_block_get()
1250 name_len = OCFS2_XATTR_SIZE(xs->here->xe_name_len); in ocfs2_xattr_block_get()
1251 i = xs->here - xs->header->xh_entries; in ocfs2_xattr_block_get()
1255 bucket_xh(xs->bucket), in ocfs2_xattr_block_get()
1263 xs->base = bucket_block(xs->bucket, block_off); in ocfs2_xattr_block_get()
1265 if (ocfs2_xattr_is_local(xs->here)) { in ocfs2_xattr_block_get()
1266 memcpy(buffer, (void *)xs->base + in ocfs2_xattr_block_get()
1270 (xs->base + name_offset + name_len); in ocfs2_xattr_block_get()
1281 ocfs2_xattr_bucket_free(xs->bucket); in ocfs2_xattr_block_get()
1283 brelse(xs->xattr_bh); in ocfs2_xattr_block_get()
1284 xs->xattr_bh = NULL; in ocfs2_xattr_block_get()
2684 struct ocfs2_xattr_search *xs) in ocfs2_xattr_ibody_find() argument
2687 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_ibody_find()
2702 xs->xattr_bh = xs->inode_bh; in ocfs2_xattr_ibody_find()
2703 xs->end = (void *)di + inode->i_sb->s_blocksize; in ocfs2_xattr_ibody_find()
2705 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2706 (xs->end - le16_to_cpu(di->i_xattr_inline_size)); in ocfs2_xattr_ibody_find()
2708 xs->header = (struct ocfs2_xattr_header *) in ocfs2_xattr_ibody_find()
2709 (xs->end - OCFS2_SB(inode->i_sb)->s_xattr_inline_size); in ocfs2_xattr_ibody_find()
2710 xs->base = (void *)xs->header; in ocfs2_xattr_ibody_find()
2711 xs->here = xs->header->xh_entries; in ocfs2_xattr_ibody_find()
2715 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_ibody_find()
2718 xs->not_found = ret; in ocfs2_xattr_ibody_find()
2779 struct ocfs2_xattr_search *xs, in ocfs2_xattr_ibody_set() argument
2791 ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt); in ocfs2_xattr_ibody_set()
2799 ocfs2_init_dinode_xa_loc(&loc, inode, xs->inode_bh, in ocfs2_xattr_ibody_set()
2800 xs->not_found ? NULL : xs->here); in ocfs2_xattr_ibody_set()
2807 xs->here = loc.xl_entry; in ocfs2_xattr_ibody_set()
2824 struct ocfs2_xattr_search *xs) in ocfs2_xattr_block_find() argument
2826 struct ocfs2_dinode *di = (struct ocfs2_dinode *)xs->inode_bh->b_data; in ocfs2_xattr_block_find()
2841 xs->xattr_bh = blk_bh; in ocfs2_xattr_block_find()
2845 xs->header = &xb->xb_attrs.xb_header; in ocfs2_xattr_block_find()
2846 xs->base = (void *)xs->header; in ocfs2_xattr_block_find()
2847 xs->end = (void *)(blk_bh->b_data) + blk_bh->b_size; in ocfs2_xattr_block_find()
2848 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_find()
2850 ret = ocfs2_xattr_find_entry(name_index, name, xs); in ocfs2_xattr_block_find()
2854 name, xs); in ocfs2_xattr_block_find()
2857 xs->xattr_bh = NULL; in ocfs2_xattr_block_find()
2860 xs->not_found = ret; in ocfs2_xattr_block_find()
2962 struct ocfs2_xattr_search *xs, in ocfs2_xattr_block_set() argument
2970 if (!xs->xattr_bh) { in ocfs2_xattr_block_set()
2971 ret = ocfs2_create_xattr_block(inode, xs->inode_bh, ctxt, in ocfs2_xattr_block_set()
2978 xs->xattr_bh = new_bh; in ocfs2_xattr_block_set()
2979 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2980 xs->header = &xblk->xb_attrs.xb_header; in ocfs2_xattr_block_set()
2981 xs->base = (void *)xs->header; in ocfs2_xattr_block_set()
2982 xs->end = (void *)xblk + inode->i_sb->s_blocksize; in ocfs2_xattr_block_set()
2983 xs->here = xs->header->xh_entries; in ocfs2_xattr_block_set()
2985 xblk = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; in ocfs2_xattr_block_set()
2988 ocfs2_init_xattr_block_xa_loc(&loc, inode, xs->xattr_bh, in ocfs2_xattr_block_set()
2989 xs->not_found ? NULL : xs->here); in ocfs2_xattr_block_set()
2993 xs->here = loc.xl_entry; in ocfs2_xattr_block_set()
2997 ret = ocfs2_xattr_create_index_block(inode, xs, ctxt); in ocfs2_xattr_block_set()
3004 ret = ocfs2_xattr_set_entry_index_block(inode, xi, xs, ctxt); in ocfs2_xattr_block_set()
3013 struct ocfs2_xattr_search *xs) in ocfs2_xattr_can_be_in_inode() argument
3017 size_t min_offs = xs->end - xs->base; in ocfs2_xattr_can_be_in_inode()
3019 if (!xs->header) in ocfs2_xattr_can_be_in_inode()
3022 last = xs->header->xh_entries; in ocfs2_xattr_can_be_in_inode()
3024 for (i = 0; i < le16_to_cpu(xs->header->xh_count); i++) { in ocfs2_xattr_can_be_in_inode()
3031 free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; in ocfs2_xattr_can_be_in_inode()
3035 BUG_ON(!xs->not_found); in ocfs2_xattr_can_be_in_inode()
3827 struct ocfs2_xattr_search *xs) in ocfs2_xattr_bucket_find() argument
3907 ret = ocfs2_read_xattr_bucket(xs->bucket, lower_blkno); in ocfs2_xattr_bucket_find()
3913 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_bucket_find()
3914 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_bucket_find()
3915 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_bucket_find()
3918 xs->here = &xs->header->xh_entries[index]; in ocfs2_xattr_bucket_find()
3921 (unsigned long long)bucket_blkno(xs->bucket), in ocfs2_xattr_bucket_find()
3935 struct ocfs2_xattr_search *xs) in ocfs2_xattr_index_block_find() argument
3969 p_blkno, first_hash, num_clusters, xs); in ocfs2_xattr_index_block_find()
4261 struct ocfs2_xattr_search *xs, in ocfs2_xattr_update_xattr_search() argument
4269 xs->header = bucket_xh(xs->bucket); in ocfs2_xattr_update_xattr_search()
4270 xs->base = bucket_block(xs->bucket, 0); in ocfs2_xattr_update_xattr_search()
4271 xs->end = xs->base + inode->i_sb->s_blocksize; in ocfs2_xattr_update_xattr_search()
4273 if (xs->not_found) in ocfs2_xattr_update_xattr_search()
4276 i = xs->here - old_xh->xh_entries; in ocfs2_xattr_update_xattr_search()
4277 xs->here = &xs->header->xh_entries[i]; in ocfs2_xattr_update_xattr_search()
4281 struct ocfs2_xattr_search *xs, in ocfs2_xattr_create_index_block() argument
4289 struct buffer_head *xb_bh = xs->xattr_bh; in ocfs2_xattr_create_index_block()
4299 BUG_ON(!xs->bucket); in ocfs2_xattr_create_index_block()
4331 ret = ocfs2_init_xattr_bucket(xs->bucket, blkno, 1); in ocfs2_xattr_create_index_block()
4337 ret = ocfs2_xattr_bucket_journal_access(handle, xs->bucket, in ocfs2_xattr_create_index_block()
4344 ocfs2_cp_xattr_block_to_bucket(inode, xb_bh, xs->bucket); in ocfs2_xattr_create_index_block()
4345 ocfs2_xattr_bucket_journal_dirty(handle, xs->bucket); in ocfs2_xattr_create_index_block()
4347 ocfs2_xattr_update_xattr_search(inode, xs, xb_bh); in ocfs2_xattr_create_index_block()
5554 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_bucket() argument
5562 ocfs2_init_xattr_bucket_xa_loc(&loc, xs->bucket, in ocfs2_xattr_set_entry_bucket()
5563 xs->not_found ? NULL : xs->here); in ocfs2_xattr_set_entry_bucket()
5566 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5576 xs->bucket); in ocfs2_xattr_set_entry_bucket()
5584 xs->here = loc.xl_entry; in ocfs2_xattr_set_entry_bucket()
5597 struct ocfs2_xattr_search *xs, in ocfs2_xattr_set_entry_index_block() argument
5604 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()
5621 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5629 xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5630 xs->bucket, in ocfs2_xattr_set_entry_index_block()
5644 ocfs2_xattr_bucket_relse(xs->bucket); in ocfs2_xattr_set_entry_index_block()
5645 ret = ocfs2_xattr_index_block_find(inode, xs->xattr_bh, in ocfs2_xattr_set_entry_index_block()
5647 xi->xi_name, xs); in ocfs2_xattr_set_entry_index_block()
5650 xs->not_found = ret; in ocfs2_xattr_set_entry_index_block()
5653 ret = ocfs2_xattr_set_entry_bucket(inode, xi, xs, ctxt); in ocfs2_xattr_set_entry_index_block()