• Home
  • Raw
  • Download

Lines Matching refs:frag

150 	struct ceph_inode_frag *frag;  in __get_or_create_frag()  local
156 frag = rb_entry(parent, struct ceph_inode_frag, node); in __get_or_create_frag()
157 c = ceph_frag_compare(f, frag->frag); in __get_or_create_frag()
163 return frag; in __get_or_create_frag()
166 frag = kmalloc(sizeof(*frag), GFP_NOFS); in __get_or_create_frag()
167 if (!frag) in __get_or_create_frag()
170 frag->frag = f; in __get_or_create_frag()
171 frag->split_by = 0; in __get_or_create_frag()
172 frag->mds = -1; in __get_or_create_frag()
173 frag->ndist = 0; in __get_or_create_frag()
175 rb_link_node(&frag->node, parent, p); in __get_or_create_frag()
176 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
180 return frag; in __get_or_create_frag()
191 struct ceph_inode_frag *frag = in __ceph_find_frag() local
193 int c = ceph_frag_compare(f, frag->frag); in __ceph_find_frag()
199 return frag; in __ceph_find_frag()
213 struct ceph_inode_frag *frag; in __ceph_choose_frag() local
222 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
223 if (!frag) in __ceph_choose_frag()
225 if (frag->split_by == 0) { in __ceph_choose_frag()
227 memcpy(pfrag, frag, sizeof(*pfrag)); in __ceph_choose_frag()
234 nway = 1 << frag->split_by; in __ceph_choose_frag()
236 frag->split_by, nway); in __ceph_choose_frag()
238 n = ceph_frag_make_child(t, frag->split_by, i); in __ceph_choose_frag()
270 struct ceph_inode_frag *frag; in ceph_fill_dirfrag() local
271 u32 id = le32_to_cpu(dirinfo->frag); in ceph_fill_dirfrag()
289 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
290 if (!frag) in ceph_fill_dirfrag()
292 if (frag->split_by == 0) { in ceph_fill_dirfrag()
296 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
297 kfree(frag); in ceph_fill_dirfrag()
302 frag->mds = -1; in ceph_fill_dirfrag()
303 frag->ndist = 0; in ceph_fill_dirfrag()
310 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
311 if (IS_ERR(frag)) { in ceph_fill_dirfrag()
315 ceph_vinop(inode), le32_to_cpu(dirinfo->frag)); in ceph_fill_dirfrag()
320 frag->mds = mds; in ceph_fill_dirfrag()
321 frag->ndist = min_t(u32, ndist, CEPH_MAX_DIRFRAG_REP); in ceph_fill_dirfrag()
322 for (i = 0; i < frag->ndist; i++) in ceph_fill_dirfrag()
323 frag->dist[i] = le32_to_cpu(dirinfo->dist[i]); in ceph_fill_dirfrag()
325 ceph_vinop(inode), frag->frag, frag->ndist); in ceph_fill_dirfrag()
336 return ceph_frag_compare(le32_to_cpu(ls->frag), in frag_tree_split_cmp()
337 le32_to_cpu(rs->frag)); in frag_tree_split_cmp()
340 static bool is_frag_child(u32 f, struct ceph_inode_frag *frag) in is_frag_child() argument
342 if (!frag) in is_frag_child()
344 if (ceph_frag_bits(f) != ceph_frag_bits(frag->frag) + frag->split_by) in is_frag_child()
346 return ceph_frag_contains_value(frag->frag, ceph_frag_value(f)); in is_frag_child()
354 struct ceph_inode_frag *frag, *prev_frag = NULL; in ceph_fill_fragtree() local
366 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
371 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
372 if (frag->frag != ceph_frag_make(0, 0) || rb_next(rb_node)) in ceph_fill_fragtree()
376 id = le32_to_cpu(dirinfo->frag); in ceph_fill_fragtree()
391 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
399 frag = NULL; in ceph_fill_fragtree()
401 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
402 if (ceph_frag_compare(frag->frag, id) >= 0) { in ceph_fill_fragtree()
403 if (frag->frag != id) in ceph_fill_fragtree()
404 frag = NULL; in ceph_fill_fragtree()
411 if (frag->split_by > 0 || in ceph_fill_fragtree()
412 !is_frag_child(frag->frag, prev_frag)) { in ceph_fill_fragtree()
413 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
414 if (frag->split_by > 0) in ceph_fill_fragtree()
416 kfree(frag); in ceph_fill_fragtree()
418 frag = NULL; in ceph_fill_fragtree()
420 if (!frag) { in ceph_fill_fragtree()
421 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
422 if (IS_ERR(frag)) in ceph_fill_fragtree()
425 if (frag->split_by == 0) in ceph_fill_fragtree()
427 frag->split_by = split_by; in ceph_fill_fragtree()
428 dout(" frag %x split by %d\n", frag->frag, frag->split_by); in ceph_fill_fragtree()
429 prev_frag = frag; in ceph_fill_fragtree()
432 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
435 if (frag->split_by > 0 || in ceph_fill_fragtree()
436 !is_frag_child(frag->frag, prev_frag)) { in ceph_fill_fragtree()
437 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
438 if (frag->split_by > 0) in ceph_fill_fragtree()
440 kfree(frag); in ceph_fill_fragtree()
565 struct ceph_inode_frag *frag; in ceph_evict_inode() local
600 frag = rb_entry(n, struct ceph_inode_frag, node); in ceph_evict_inode()
602 kfree(frag); in ceph_evict_inode()
1636 u32 frag = le32_to_cpu(req->r_args.readdir.frag); in ceph_readdir_prepopulate() local
1658 le32_to_cpu(rinfo->dir_dir->frag) != frag) { in ceph_readdir_prepopulate()
1660 frag, le32_to_cpu(rinfo->dir_dir->frag)); in ceph_readdir_prepopulate()
1661 frag = le32_to_cpu(rinfo->dir_dir->frag); in ceph_readdir_prepopulate()
1675 if (ceph_frag_is_leftmost(frag) && in ceph_readdir_prepopulate()
1712 rde->offset = ceph_make_fpos(frag, fpos_offset++, false); in ceph_readdir_prepopulate()