diff options
author | Christoph Hellwig <hch@lst.de> | 2019-11-08 15:05:37 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-10 16:54:23 -0800 |
commit | fdbb8c5b805c19bc2764aa1b91952e75e4c1c086 (patch) | |
tree | 119a1d43177e2fb5a352ef542d2538597370fe6c /fs/xfs/libxfs/xfs_dir2_data.c | |
parent | 5c072127d31d3a605a3048dc5d3fdfc0cdd47212 (diff) | |
download | kernel_replicant_linux-fdbb8c5b805c19bc2764aa1b91952e75e4c1c086.tar.gz kernel_replicant_linux-fdbb8c5b805c19bc2764aa1b91952e75e4c1c086.tar.bz2 kernel_replicant_linux-fdbb8c5b805c19bc2764aa1b91952e75e4c1c086.zip |
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/libxfs/xfs_dir2_data.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2_data.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2_data.c b/fs/xfs/libxfs/xfs_dir2_data.c index f5fa8b9187b0..830dfd9edfda 100644 --- a/fs/xfs/libxfs/xfs_dir2_data.c +++ b/fs/xfs/libxfs/xfs_dir2_data.c @@ -13,6 +13,7 @@ #include "xfs_mount.h" #include "xfs_inode.h" #include "xfs_dir2.h" +#include "xfs_dir2_priv.h" #include "xfs_error.h" #include "xfs_trans.h" #include "xfs_buf_item.h" @@ -179,7 +180,7 @@ __xfs_dir3_data_check( return __this_address; if (xfs_dir_ino_validate(mp, be64_to_cpu(dep->inumber))) return __this_address; - if (offset + ops->data_entsize(dep->namelen) > end) + if (offset + xfs_dir2_data_entsize(mp, dep->namelen) > end) return __this_address; if (be16_to_cpu(*ops->data_entry_tag_p(dep)) != offset) return __this_address; @@ -203,7 +204,7 @@ __xfs_dir3_data_check( if (i >= be32_to_cpu(btp->count)) return __this_address; } - offset += ops->data_entsize(dep->namelen); + offset += xfs_dir2_data_entsize(mp, dep->namelen); } /* * Need to have seen all the entries and all the bestfree slots. @@ -567,7 +568,7 @@ xfs_dir2_data_freeremove( */ void xfs_dir2_data_freescan_int( - struct xfs_da_geometry *geo, + struct xfs_mount *mp, const struct xfs_dir_ops *ops, struct xfs_dir2_data_hdr *hdr, int *loghead) @@ -588,7 +589,7 @@ xfs_dir2_data_freescan_int( memset(bf, 0, sizeof(*bf) * XFS_DIR2_DATA_FD_COUNT); *loghead = 1; - end = xfs_dir3_data_end_offset(geo, addr); + end = xfs_dir3_data_end_offset(mp->m_dir_geo, addr); while (offset < end) { struct xfs_dir2_data_unused *dup = addr + offset; struct xfs_dir2_data_entry *dep = addr + offset; @@ -608,7 +609,7 @@ xfs_dir2_data_freescan_int( * For active entries, check their tags and skip them. */ ASSERT(offset == be16_to_cpu(*ops->data_entry_tag_p(dep))); - offset += ops->data_entsize(dep->namelen); + offset += xfs_dir2_data_entsize(mp, dep->namelen); } } @@ -618,8 +619,7 @@ xfs_dir2_data_freescan( struct xfs_dir2_data_hdr *hdr, int *loghead) { - return xfs_dir2_data_freescan_int(dp->i_mount->m_dir_geo, dp->d_ops, - hdr, loghead); + return xfs_dir2_data_freescan_int(dp->i_mount, dp->d_ops, hdr, loghead); } /* |