Lines Matching refs:frag
121 struct ceph_inode_frag *frag; in __get_or_create_frag() local
127 frag = rb_entry(parent, struct ceph_inode_frag, node); in __get_or_create_frag()
128 c = ceph_frag_compare(f, frag->frag); in __get_or_create_frag()
134 return frag; in __get_or_create_frag()
137 frag = kmalloc(sizeof(*frag), GFP_NOFS); in __get_or_create_frag()
138 if (!frag) { in __get_or_create_frag()
144 frag->frag = f; in __get_or_create_frag()
145 frag->split_by = 0; in __get_or_create_frag()
146 frag->mds = -1; in __get_or_create_frag()
147 frag->ndist = 0; in __get_or_create_frag()
149 rb_link_node(&frag->node, parent, p); in __get_or_create_frag()
150 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
154 return frag; in __get_or_create_frag()
165 struct ceph_inode_frag *frag = in __ceph_find_frag() local
167 int c = ceph_frag_compare(f, frag->frag); in __ceph_find_frag()
173 return frag; in __ceph_find_frag()
187 struct ceph_inode_frag *frag; in __ceph_choose_frag() local
196 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
197 if (!frag) in __ceph_choose_frag()
199 if (frag->split_by == 0) { in __ceph_choose_frag()
201 memcpy(pfrag, frag, sizeof(*pfrag)); in __ceph_choose_frag()
208 nway = 1 << frag->split_by; in __ceph_choose_frag()
210 frag->split_by, nway); in __ceph_choose_frag()
212 n = ceph_frag_make_child(t, frag->split_by, i); in __ceph_choose_frag()
244 struct ceph_inode_frag *frag; in ceph_fill_dirfrag() local
245 u32 id = le32_to_cpu(dirinfo->frag); in ceph_fill_dirfrag()
260 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
261 if (!frag) in ceph_fill_dirfrag()
263 if (frag->split_by == 0) { in ceph_fill_dirfrag()
267 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
268 kfree(frag); in ceph_fill_dirfrag()
273 frag->mds = -1; in ceph_fill_dirfrag()
274 frag->ndist = 0; in ceph_fill_dirfrag()
281 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
282 if (IS_ERR(frag)) { in ceph_fill_dirfrag()
286 ceph_vinop(inode), le32_to_cpu(dirinfo->frag)); in ceph_fill_dirfrag()
291 frag->mds = mds; in ceph_fill_dirfrag()
292 frag->ndist = min_t(u32, ndist, CEPH_MAX_DIRFRAG_REP); in ceph_fill_dirfrag()
293 for (i = 0; i < frag->ndist; i++) in ceph_fill_dirfrag()
294 frag->dist[i] = le32_to_cpu(dirinfo->dist[i]); in ceph_fill_dirfrag()
296 ceph_vinop(inode), frag->frag, frag->ndist); in ceph_fill_dirfrag()
308 struct ceph_inode_frag *frag; in ceph_fill_fragtree() local
318 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
323 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
324 if (frag->frag != ceph_frag_make(0, 0) || rb_next(rb_node)) in ceph_fill_fragtree()
328 id = le32_to_cpu(dirinfo->frag); in ceph_fill_fragtree()
338 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
339 frag = NULL; in ceph_fill_fragtree()
341 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
342 if (ceph_frag_compare(frag->frag, id) >= 0) { in ceph_fill_fragtree()
343 if (frag->frag != id) in ceph_fill_fragtree()
344 frag = NULL; in ceph_fill_fragtree()
350 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
351 kfree(frag); in ceph_fill_fragtree()
352 frag = NULL; in ceph_fill_fragtree()
354 if (!frag) { in ceph_fill_fragtree()
355 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
356 if (IS_ERR(frag)) in ceph_fill_fragtree()
359 frag->split_by = le32_to_cpu(fragtree->splits[i].by); in ceph_fill_fragtree()
360 dout(" frag %x split by %d\n", frag->frag, frag->split_by); in ceph_fill_fragtree()
363 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
365 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
366 kfree(frag); in ceph_fill_fragtree()
483 struct ceph_inode_frag *frag; in ceph_destroy_inode() local
510 frag = rb_entry(n, struct ceph_inode_frag, node); in ceph_destroy_inode()
512 kfree(frag); in ceph_destroy_inode()
1349 u32 frag = le32_to_cpu(rhead->args.readdir.frag); in ceph_readdir_prepopulate() local
1352 le32_to_cpu(rinfo->dir_dir->frag) != frag) { in ceph_readdir_prepopulate()
1354 frag, le32_to_cpu(rinfo->dir_dir->frag)); in ceph_readdir_prepopulate()
1355 frag = le32_to_cpu(rinfo->dir_dir->frag); in ceph_readdir_prepopulate()
1356 if (ceph_frag_is_leftmost(frag)) in ceph_readdir_prepopulate()
1461 di->offset = ceph_make_fpos(frag, i + r_readdir_offset); in ceph_readdir_prepopulate()