• Home
  • Raw
  • Download

Lines Matching refs:frag

119 	struct ceph_inode_frag *frag;  in __get_or_create_frag()  local
125 frag = rb_entry(parent, struct ceph_inode_frag, node); in __get_or_create_frag()
126 c = ceph_frag_compare(f, frag->frag); in __get_or_create_frag()
132 return frag; in __get_or_create_frag()
135 frag = kmalloc(sizeof(*frag), GFP_NOFS); in __get_or_create_frag()
136 if (!frag) { in __get_or_create_frag()
142 frag->frag = f; in __get_or_create_frag()
143 frag->split_by = 0; in __get_or_create_frag()
144 frag->mds = -1; in __get_or_create_frag()
145 frag->ndist = 0; in __get_or_create_frag()
147 rb_link_node(&frag->node, parent, p); in __get_or_create_frag()
148 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
152 return frag; in __get_or_create_frag()
163 struct ceph_inode_frag *frag = in __ceph_find_frag() local
165 int c = ceph_frag_compare(f, frag->frag); in __ceph_find_frag()
171 return frag; in __ceph_find_frag()
185 struct ceph_inode_frag *frag; in __ceph_choose_frag() local
194 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
195 if (!frag) in __ceph_choose_frag()
197 if (frag->split_by == 0) { in __ceph_choose_frag()
199 memcpy(pfrag, frag, sizeof(*pfrag)); in __ceph_choose_frag()
206 nway = 1 << frag->split_by; in __ceph_choose_frag()
208 frag->split_by, nway); in __ceph_choose_frag()
210 n = ceph_frag_make_child(t, frag->split_by, i); in __ceph_choose_frag()
242 struct ceph_inode_frag *frag; in ceph_fill_dirfrag() local
243 u32 id = le32_to_cpu(dirinfo->frag); in ceph_fill_dirfrag()
261 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
262 if (!frag) in ceph_fill_dirfrag()
264 if (frag->split_by == 0) { in ceph_fill_dirfrag()
268 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
269 kfree(frag); in ceph_fill_dirfrag()
274 frag->mds = -1; in ceph_fill_dirfrag()
275 frag->ndist = 0; in ceph_fill_dirfrag()
282 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
283 if (IS_ERR(frag)) { in ceph_fill_dirfrag()
287 ceph_vinop(inode), le32_to_cpu(dirinfo->frag)); in ceph_fill_dirfrag()
292 frag->mds = mds; in ceph_fill_dirfrag()
293 frag->ndist = min_t(u32, ndist, CEPH_MAX_DIRFRAG_REP); in ceph_fill_dirfrag()
294 for (i = 0; i < frag->ndist; i++) in ceph_fill_dirfrag()
295 frag->dist[i] = le32_to_cpu(dirinfo->dist[i]); in ceph_fill_dirfrag()
297 ceph_vinop(inode), frag->frag, frag->ndist); in ceph_fill_dirfrag()
308 return ceph_frag_compare(le32_to_cpu(ls->frag), in frag_tree_split_cmp()
309 le32_to_cpu(rs->frag)); in frag_tree_split_cmp()
312 static bool is_frag_child(u32 f, struct ceph_inode_frag *frag) in is_frag_child() argument
314 if (!frag) in is_frag_child()
316 if (ceph_frag_bits(f) != ceph_frag_bits(frag->frag) + frag->split_by) in is_frag_child()
318 return ceph_frag_contains_value(frag->frag, ceph_frag_value(f)); in is_frag_child()
326 struct ceph_inode_frag *frag, *prev_frag = NULL; in ceph_fill_fragtree() local
338 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
343 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
344 if (frag->frag != ceph_frag_make(0, 0) || rb_next(rb_node)) in ceph_fill_fragtree()
348 id = le32_to_cpu(dirinfo->frag); in ceph_fill_fragtree()
363 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
371 frag = NULL; in ceph_fill_fragtree()
373 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
374 if (ceph_frag_compare(frag->frag, id) >= 0) { in ceph_fill_fragtree()
375 if (frag->frag != id) in ceph_fill_fragtree()
376 frag = NULL; in ceph_fill_fragtree()
383 if (frag->split_by > 0 || in ceph_fill_fragtree()
384 !is_frag_child(frag->frag, prev_frag)) { in ceph_fill_fragtree()
385 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
386 if (frag->split_by > 0) in ceph_fill_fragtree()
388 kfree(frag); in ceph_fill_fragtree()
390 frag = NULL; in ceph_fill_fragtree()
392 if (!frag) { in ceph_fill_fragtree()
393 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
394 if (IS_ERR(frag)) in ceph_fill_fragtree()
397 if (frag->split_by == 0) in ceph_fill_fragtree()
399 frag->split_by = split_by; in ceph_fill_fragtree()
400 dout(" frag %x split by %d\n", frag->frag, frag->split_by); in ceph_fill_fragtree()
401 prev_frag = frag; in ceph_fill_fragtree()
404 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
407 if (frag->split_by > 0 || in ceph_fill_fragtree()
408 !is_frag_child(frag->frag, prev_frag)) { in ceph_fill_fragtree()
409 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
410 if (frag->split_by > 0) in ceph_fill_fragtree()
412 kfree(frag); in ceph_fill_fragtree()
532 struct ceph_inode_frag *frag; in ceph_destroy_inode() local
559 frag = rb_entry(n, struct ceph_inode_frag, node); in ceph_destroy_inode()
561 kfree(frag); in ceph_destroy_inode()
1480 u32 frag = le32_to_cpu(rhead->args.readdir.frag); in ceph_readdir_prepopulate() local
1495 le32_to_cpu(rinfo->dir_dir->frag) != frag) { in ceph_readdir_prepopulate()
1497 frag, le32_to_cpu(rinfo->dir_dir->frag)); in ceph_readdir_prepopulate()
1498 frag = le32_to_cpu(rinfo->dir_dir->frag); in ceph_readdir_prepopulate()
1515 if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2 && in ceph_readdir_prepopulate()
1548 rde->offset = ceph_make_fpos(frag, fpos_offset++, false); in ceph_readdir_prepopulate()