@@ -749,6 +749,8 @@ xfs_dir2_block_lookup_int(
cmp = xfs_dir2_compname(args, dep->name, dep->namelen);
if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
args->cmpresult = cmp;
+ args->offset = xfs_dir2_byte_to_dataptr(
+ (char *)dep - (char *)hdr);
*bpp = bp;
*entno = mid;
if (cmp == XFS_CMP_EXACT)
@@ -1300,6 +1300,8 @@ xfs_dir2_leaf_lookup_int(
cmp = xfs_dir2_compname(args, dep->name, dep->namelen);
if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) {
args->cmpresult = cmp;
+ args->offset = xfs_dir2_db_off_to_dataptr(args->geo,
+ newdb, (char *)dep - (char *)dbp->b_addr);
*indexp = index;
/* case exact match: return the current buffer. */
if (cmp == XFS_CMP_EXACT) {
@@ -887,6 +887,8 @@ xfs_dir2_leafn_lookup_for_entry(
args->cmpresult = cmp;
args->inumber = be64_to_cpu(dep->inumber);
args->filetype = xfs_dir2_data_get_ftype(mp, dep);
+ args->offset = xfs_dir2_db_off_to_dataptr(args->geo,
++ newdb, (char *)dep - (char *)curbp->b_addr);
*indexp = index;
state->extravalid = 1;
state->extrablk.bp = curbp;
@@ -889,6 +889,7 @@ xfs_dir2_sf_lookup(
args->inumber = dp->i_ino;
args->cmpresult = XFS_CMP_EXACT;
args->filetype = XFS_DIR3_FT_DIR;
+ args->offset = 1;
return -EEXIST;
}
/*
@@ -899,6 +900,7 @@ xfs_dir2_sf_lookup(
args->inumber = xfs_dir2_sf_get_parent_ino(sfp);
args->cmpresult = XFS_CMP_EXACT;
args->filetype = XFS_DIR3_FT_DIR;
+ args->offset = 2;
return -EEXIST;
}
/*
@@ -917,6 +919,8 @@ xfs_dir2_sf_lookup(
args->cmpresult = cmp;
args->inumber = xfs_dir2_sf_get_ino(mp, sfp, sfep);
args->filetype = xfs_dir2_sf_get_ftype(mp, sfep);
+ args->offset = xfs_dir2_byte_to_dataptr(
+ xfs_dir2_sf_get_offset(sfep));
if (cmp == XFS_CMP_EXACT)
return -EEXIST;
ci_sfep = sfep;