Lines Matching refs:path
73 struct xchk_dirpath *path, *n; in xchk_dirtree_buf_cleanup() local
78 xchk_dirtree_for_each_path_safe(dl, path, n) { in xchk_dirtree_buf_cleanup()
79 list_del_init(&path->list); in xchk_dirtree_buf_cleanup()
80 xino_bitmap_destroy(&path->seen_inodes); in xchk_dirtree_buf_cleanup()
81 kfree(path); in xchk_dirtree_buf_cleanup()
158 struct xchk_dirpath *path, in xchk_dirpath_append() argument
172 if (path->nr_steps >= XFS_MAXLINK) in xchk_dirpath_append()
179 error = xino_bitmap_set(&path->seen_inodes, ip->i_ino); in xchk_dirpath_append()
187 path->nr_steps++; in xchk_dirpath_append()
217 struct xchk_dirpath *path; in xchk_dirtree_create_path() local
242 path = kmalloc(sizeof(struct xchk_dirpath), XCHK_GFP_FLAGS); in xchk_dirtree_create_path()
243 if (!path) in xchk_dirtree_create_path()
246 INIT_LIST_HEAD(&path->list); in xchk_dirtree_create_path()
247 xino_bitmap_init(&path->seen_inodes); in xchk_dirtree_create_path()
248 path->nr_steps = 0; in xchk_dirtree_create_path()
249 path->outcome = XCHK_DIRPATH_SCANNING; in xchk_dirtree_create_path()
251 error = xchk_dirpath_append(dl, sc->ip, path, &xname, rec); in xchk_dirtree_create_path()
255 path->first_step = xfarray_length(dl->path_steps) - 1; in xchk_dirtree_create_path()
256 path->second_step = XFARRAY_NULLIDX; in xchk_dirtree_create_path()
257 path->path_nr = dl->nr_paths; in xchk_dirtree_create_path()
259 list_add_tail(&path->list, &dl->path_list); in xchk_dirtree_create_path()
263 kfree(path); in xchk_dirtree_create_path()
280 struct xchk_dirpath *path) in xchk_dirpath_revalidate() argument
293 trace_xchk_dirpath_disappeared(dl->sc, sc->ip, path->path_nr, in xchk_dirpath_revalidate()
294 path->first_step, &dl->xname, &dl->pptr_rec); in xchk_dirpath_revalidate()
347 struct xchk_dirpath *path, in xchk_dirpath_set_outcome() argument
350 trace_xchk_dirpath_set_outcome(dl->sc, path->path_nr, path->nr_steps, in xchk_dirpath_set_outcome()
353 path->outcome = outcome; in xchk_dirpath_set_outcome()
365 struct xchk_dirpath *path) in xchk_dirpath_step_up() argument
388 xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_OK); in xchk_dirpath_step_up()
398 xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_DELETE); in xchk_dirpath_step_up()
408 if (xino_bitmap_test(&path->seen_inodes, parent_ino)) { in xchk_dirpath_step_up()
409 xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_LOOP); in xchk_dirpath_step_up()
416 trace_xchk_dirpath_badgen(dl->sc, dp, path->path_nr, in xchk_dirpath_step_up()
417 path->nr_steps, &dl->xname, &dl->pptr_rec); in xchk_dirpath_step_up()
424 trace_xchk_dirpath_nondir_parent(dl->sc, dp, path->path_nr, in xchk_dirpath_step_up()
425 path->nr_steps, &dl->xname, &dl->pptr_rec); in xchk_dirpath_step_up()
432 trace_xchk_dirpath_unlinked_parent(dl->sc, dp, path->path_nr, in xchk_dirpath_step_up()
433 path->nr_steps, &dl->xname, &dl->pptr_rec); in xchk_dirpath_step_up()
466 xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_CORRUPT); in xchk_dirpath_step_up()
478 trace_xchk_dirpath_found_next_step(sc, dp, path->path_nr, in xchk_dirpath_step_up()
479 path->nr_steps, &dl->xname, &dl->pptr_rec); in xchk_dirpath_step_up()
482 error = xchk_dirpath_append(dl, dp, path, &dl->xname, &dl->pptr_rec); in xchk_dirpath_step_up()
486 if (path->second_step == XFARRAY_NULLIDX) in xchk_dirpath_step_up()
487 path->second_step = xfarray_length(dl->path_steps) - 1; in xchk_dirpath_step_up()
508 struct xchk_dirpath *path) in xchk_dirpath_walk_upwards() argument
516 error = xchk_dirpath_revalidate(dl, path); in xchk_dirpath_walk_upwards()
520 trace_xchk_dirpath_walk_upwards(sc, sc->ip, path->path_nr, &dl->xname, in xchk_dirpath_walk_upwards()
528 xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_DELETE); in xchk_dirpath_walk_upwards()
550 error = xchk_dirpath_step_up(dl, path); in xchk_dirpath_walk_upwards()
562 while (!error && path->outcome == XCHK_DIRPATH_SCANNING) in xchk_dirpath_walk_upwards()
563 error = xchk_dirpath_step_up(dl, path); in xchk_dirpath_walk_upwards()
569 xchk_dirpath_set_outcome(dl, path, XCHK_DIRPATH_CORRUPT); in xchk_dirpath_walk_upwards()
584 struct xchk_dirpath *path, in xchk_dirpath_step_is_stale() argument
626 path->outcome == XREP_DIRPATH_ADOPTING) { in xchk_dirpath_step_is_stale()
627 xchk_dirpath_set_outcome(dl, path, XREP_DIRPATH_ADOPTED); in xchk_dirpath_step_is_stale()
632 path->outcome == XREP_DIRPATH_DELETING) { in xchk_dirpath_step_is_stale()
633 xchk_dirpath_set_outcome(dl, path, XREP_DIRPATH_DELETED); in xchk_dirpath_step_is_stale()
638 trace_xchk_dirpath_changed(dl->sc, path->path_nr, step_nr, p->dp, in xchk_dirpath_step_is_stale()
650 struct xchk_dirpath *path, in xchk_dirpath_is_stale() argument
654 xfarray_idx_t idx = path->first_step; in xchk_dirpath_is_stale()
662 if (!xino_bitmap_test(&path->seen_inodes, p->ip->i_ino)) in xchk_dirpath_is_stale()
665 ret = xchk_dirpath_step_is_stale(dl, path, 0, idx, p, &cursor); in xchk_dirpath_is_stale()
669 for (i = 1, idx = path->second_step; i < path->nr_steps; i++, idx++) { in xchk_dirpath_is_stale()
670 ret = xchk_dirpath_step_is_stale(dl, path, i, idx, p, &cursor); in xchk_dirpath_is_stale()
690 struct xchk_dirpath *path; in xchk_dirtree_live_update() local
703 xchk_dirtree_for_each_path(dl, path) { in xchk_dirtree_live_update()
704 ret = xchk_dirpath_is_stale(dl, path, p); in xchk_dirtree_live_update()
726 struct xchk_dirpath *path, *n; in xchk_dirtree_reset() local
730 xchk_dirtree_for_each_path_safe(dl, path, n) { in xchk_dirtree_reset()
731 list_del_init(&path->list); in xchk_dirtree_reset()
732 xino_bitmap_destroy(&path->seen_inodes); in xchk_dirtree_reset()
733 kfree(path); in xchk_dirtree_reset()
750 struct xchk_dirpath *path) in xchk_dirtree_load_path() argument
755 error = xfarray_load(dl->path_steps, path->first_step, &step); in xchk_dirtree_load_path()
780 struct xchk_dirpath *path; in xchk_dirtree_find_paths_to_root() local
809 xchk_dirtree_for_each_path(dl, path) { in xchk_dirtree_find_paths_to_root()
811 error = xchk_dirtree_load_path(dl, path); in xchk_dirtree_find_paths_to_root()
820 error = xchk_dirpath_walk_upwards(dl, path); in xchk_dirtree_find_paths_to_root()
852 struct xchk_dirpath *path; in xchk_dirtree_evaluate() local
858 xchk_dirtree_for_each_path(dl, path) { in xchk_dirtree_evaluate()
859 trace_xchk_dirpath_evaluate_path(dl->sc, path->path_nr, in xchk_dirtree_evaluate()
860 path->nr_steps, path->outcome); in xchk_dirtree_evaluate()
862 switch (path->outcome) { in xchk_dirtree_evaluate()