@@ -105,7 +105,7 @@ xchk_dir_actor(
}
/* Verify that we can look up this name by hash. */
- error = xchk_dir_lookup(sc, dp, name, &lookup_ino);
+ error = xchk_dir_lookup(sc, dp, name, &lookup_ino, NULL);
/* ENOENT means the hash lookup failed and the dir is corrupt */
if (error == -ENOENT)
error = -EFSCORRUPTED;
@@ -314,7 +314,8 @@ xchk_dir_lookup(
struct xfs_scrub *sc,
struct xfs_inode *dp,
const struct xfs_name *name,
- xfs_ino_t *ino)
+ xfs_ino_t *ino,
+ xfs_dir2_dataptr_t *diroffsetp)
{
struct xfs_da_args args = {
.dp = dp,
@@ -326,10 +327,14 @@ xchk_dir_lookup(
.hashval = xfs_dir2_hashname(dp->i_mount, name),
.whichfork = XFS_DATA_FORK,
.op_flags = XFS_DA_OP_OKNOENT,
+ .offset = XFS_DIR2_NULL_DATAPTR,
};
bool isblock, isleaf;
int error;
+ if (diroffsetp)
+ *diroffsetp = XFS_DIR2_NULL_DATAPTR;
+
if (xfs_is_shutdown(dp->i_mount))
return -EIO;
@@ -369,7 +374,10 @@ xchk_dir_lookup(
out_check_rval:
if (error == -EEXIST)
error = 0;
- if (!error)
+ if (!error) {
*ino = args.inumber;
+ if (diroffsetp)
+ *diroffsetp = args.offset;
+ }
return error;
}
@@ -14,6 +14,7 @@ int xchk_dir_walk(struct xfs_scrub *sc, struct xfs_inode *dp,
xchk_dirent_fn dirent_fn, void *priv);
int xchk_dir_lookup(struct xfs_scrub *sc, struct xfs_inode *dp,
- const struct xfs_name *name, xfs_ino_t *ino);
+ const struct xfs_name *name, xfs_ino_t *ino,
+ xfs_dir2_dataptr_t *diroffsetp);
#endif /* __XFS_SCRUB_READDIR_H__ */