Lines Matching refs:frag

120 	struct ceph_inode_frag *frag;  in __get_or_create_frag()  local
126 frag = rb_entry(parent, struct ceph_inode_frag, node); in __get_or_create_frag()
127 c = ceph_frag_compare(f, frag->frag); in __get_or_create_frag()
133 return frag; in __get_or_create_frag()
136 frag = kmalloc(sizeof(*frag), GFP_NOFS); in __get_or_create_frag()
137 if (!frag) { in __get_or_create_frag()
143 frag->frag = f; in __get_or_create_frag()
144 frag->split_by = 0; in __get_or_create_frag()
145 frag->mds = -1; in __get_or_create_frag()
146 frag->ndist = 0; in __get_or_create_frag()
148 rb_link_node(&frag->node, parent, p); in __get_or_create_frag()
149 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
153 return frag; in __get_or_create_frag()
164 struct ceph_inode_frag *frag = in __ceph_find_frag() local
166 int c = ceph_frag_compare(f, frag->frag); in __ceph_find_frag()
172 return frag; in __ceph_find_frag()
186 struct ceph_inode_frag *frag; in __ceph_choose_frag() local
195 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
196 if (!frag) in __ceph_choose_frag()
198 if (frag->split_by == 0) { in __ceph_choose_frag()
200 memcpy(pfrag, frag, sizeof(*pfrag)); in __ceph_choose_frag()
207 nway = 1 << frag->split_by; in __ceph_choose_frag()
209 frag->split_by, nway); in __ceph_choose_frag()
211 n = ceph_frag_make_child(t, frag->split_by, i); in __ceph_choose_frag()
243 struct ceph_inode_frag *frag; in ceph_fill_dirfrag() local
244 u32 id = le32_to_cpu(dirinfo->frag); in ceph_fill_dirfrag()
259 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
260 if (!frag) in ceph_fill_dirfrag()
262 if (frag->split_by == 0) { in ceph_fill_dirfrag()
266 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
267 kfree(frag); in ceph_fill_dirfrag()
272 frag->mds = -1; in ceph_fill_dirfrag()
273 frag->ndist = 0; in ceph_fill_dirfrag()
280 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
281 if (IS_ERR(frag)) { in ceph_fill_dirfrag()
285 ceph_vinop(inode), le32_to_cpu(dirinfo->frag)); in ceph_fill_dirfrag()
290 frag->mds = mds; in ceph_fill_dirfrag()
291 frag->ndist = min_t(u32, ndist, CEPH_MAX_DIRFRAG_REP); in ceph_fill_dirfrag()
292 for (i = 0; i < frag->ndist; i++) in ceph_fill_dirfrag()
293 frag->dist[i] = le32_to_cpu(dirinfo->dist[i]); in ceph_fill_dirfrag()
295 ceph_vinop(inode), frag->frag, frag->ndist); in ceph_fill_dirfrag()
307 struct ceph_inode_frag *frag; in ceph_fill_fragtree() local
317 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
322 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
323 if (frag->frag != ceph_frag_make(0, 0) || rb_next(rb_node)) in ceph_fill_fragtree()
327 id = le32_to_cpu(dirinfo->frag); in ceph_fill_fragtree()
337 id = le32_to_cpu(fragtree->splits[i].frag); in ceph_fill_fragtree()
338 frag = NULL; in ceph_fill_fragtree()
340 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
341 if (ceph_frag_compare(frag->frag, id) >= 0) { in ceph_fill_fragtree()
342 if (frag->frag != id) in ceph_fill_fragtree()
343 frag = NULL; in ceph_fill_fragtree()
349 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
350 kfree(frag); in ceph_fill_fragtree()
351 frag = NULL; in ceph_fill_fragtree()
353 if (!frag) { in ceph_fill_fragtree()
354 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
355 if (IS_ERR(frag)) in ceph_fill_fragtree()
358 frag->split_by = le32_to_cpu(fragtree->splits[i].by); in ceph_fill_fragtree()
359 dout(" frag %x split by %d\n", frag->frag, frag->split_by); in ceph_fill_fragtree()
362 frag = rb_entry(rb_node, struct ceph_inode_frag, node); in ceph_fill_fragtree()
364 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
365 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()
1396 u32 frag = le32_to_cpu(rhead->args.readdir.frag); in ceph_readdir_prepopulate() local
1403 le32_to_cpu(rinfo->dir_dir->frag) != frag) { in ceph_readdir_prepopulate()
1405 frag, le32_to_cpu(rinfo->dir_dir->frag)); in ceph_readdir_prepopulate()
1406 frag = le32_to_cpu(rinfo->dir_dir->frag); in ceph_readdir_prepopulate()
1407 if (ceph_frag_is_leftmost(frag)) in ceph_readdir_prepopulate()
1425 if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2) { in ceph_readdir_prepopulate()
1515 di->offset = ceph_make_fpos(frag, i + req->r_readdir_offset); in ceph_readdir_prepopulate()