From: Darrick J. Wong <djwong@xxxxxxxxxx> handle_walk_parents already walks each returned parent pointer record, so we don't need a loop in handle_walk_parent_path_ptr. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- libfrog/pptrs.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/libfrog/pptrs.c b/libfrog/pptrs.c index ef91a919..8d9e62a2 100644 --- a/libfrog/pptrs.c +++ b/libfrog/pptrs.c @@ -134,26 +134,22 @@ handle_walk_parent_path_ptr( { struct walk_ppath_level_info *wpli = arg; struct walk_ppaths_info *wpi = wpli->wpi; - unsigned int i; int ret = 0; if (pi->pi_flags & XFS_PPTR_OFLAG_ROOT) return wpi->fn(wpi->mntpt, wpi->path, wpi->arg); - for (i = 0; i < pi->pi_ptrs_used; i++) { - p = xfs_ppinfo_to_pp(pi, i); - ret = path_component_change(wpli->pc, p->xpp_name, + ret = path_component_change(wpli->pc, p->xpp_name, strlen((char *)p->xpp_name), p->xpp_ino); - if (ret) - break; - wpli->newhandle.ha_fid.fid_ino = p->xpp_ino; - wpli->newhandle.ha_fid.fid_gen = p->xpp_gen; - path_list_add_parent_component(wpi->path, wpli->pc); - ret = handle_walk_parent_paths(wpi, &wpli->newhandle); - path_list_del_component(wpi->path, wpli->pc); - if (ret) - break; - } + if (ret) + return ret; + + wpli->newhandle.ha_fid.fid_ino = p->xpp_ino; + wpli->newhandle.ha_fid.fid_gen = p->xpp_gen; + + path_list_add_parent_component(wpi->path, wpli->pc); + ret = handle_walk_parent_paths(wpi, &wpli->newhandle); + path_list_del_component(wpi->path, wpli->pc); return ret; }