summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_dir2_readdir.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-09 02:05:37 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-11 03:54:23 +0300
commitfdbb8c5b805c19bc2764aa1b91952e75e4c1c086 (patch)
tree119a1d43177e2fb5a352ef542d2538597370fe6c /fs/xfs/xfs_dir2_readdir.c
parent5c072127d31d3a605a3048dc5d3fdfc0cdd47212 (diff)
downloadlinux-fdbb8c5b805c19bc2764aa1b91952e75e4c1c086.tar.xz
xfs: devirtualize ->data_entsize
Replace the ->data_entsize dir ops method with a directly called xfs_dir2_data_entsize helper that takes care of the differences between the directory format with and without the file type field. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_readdir.c')
-rw-r--r--fs/xfs/xfs_dir2_readdir.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index bf3a98967153..edc57bed0f1f 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -78,7 +78,7 @@ xfs_dir2_sf_getdents(
dp->d_ops->data_entry_offset);
dotdot_offset = xfs_dir2_db_off_to_dataptr(geo, geo->datablk,
dp->d_ops->data_entry_offset +
- dp->d_ops->data_entsize(sizeof(".") - 1));
+ xfs_dir2_data_entsize(mp, sizeof(".") - 1));
/*
* Put . entry unless we're starting past it.
@@ -192,7 +192,7 @@ xfs_dir2_block_getdents(
/*
* Bump pointer for the next iteration.
*/
- offset += dp->d_ops->data_entsize(dep->namelen);
+ offset += xfs_dir2_data_entsize(dp->i_mount, dep->namelen);
/*
* The entry is before the desired starting point, skip it.
@@ -347,6 +347,7 @@ xfs_dir2_leaf_getdents(
size_t bufsize)
{
struct xfs_inode *dp = args->dp;
+ struct xfs_mount *mp = dp->i_mount;
struct xfs_buf *bp = NULL; /* data block buffer */
xfs_dir2_data_entry_t *dep; /* data entry */
xfs_dir2_data_unused_t *dup; /* unused entry */
@@ -422,8 +423,8 @@ xfs_dir2_leaf_getdents(
continue;
}
dep = bp->b_addr + offset;
- length =
- dp->d_ops->data_entsize(dep->namelen);
+ length = xfs_dir2_data_entsize(mp,
+ dep->namelen);
offset += length;
}
/*
@@ -454,7 +455,7 @@ xfs_dir2_leaf_getdents(
}
dep = bp->b_addr + offset;
- length = dp->d_ops->data_entsize(dep->namelen);
+ length = xfs_dir2_data_entsize(mp, dep->namelen);
filetype = dp->d_ops->data_get_ftype(dep);
ctx->pos = xfs_dir2_byte_to_dataptr(curoff) & 0x7fffffff;