xfs: devirtualize ->sf_get_ftype and ->sf_put_ftype

Replace the ->sf_get_ftype and ->sf_put_ftype dir ops methods with
directly called xfs_dir2_sf_get_ftype and xfs_dir2_sf_put_ftype helpers
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>
This commit is contained in:
Christoph Hellwig
2019-11-08 15:03:30 -08:00
committed by Darrick J. Wong
parent 93b1e96a42
commit 4501ed2a3a
6 changed files with 50 additions and 72 deletions

View File

@@ -115,7 +115,7 @@ xfs_dir2_sf_getdents(
}
ino = xfs_dir2_sf_get_ino(mp, sfp, sfep);
filetype = dp->d_ops->sf_get_ftype(sfep);
filetype = xfs_dir2_sf_get_ftype(mp, sfep);
ctx->pos = off & 0x7fffffff;
if (!xfs_dir2_namecheck(sfep->name, sfep->namelen)) {
XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW,