summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_da_format.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-08 14:57:49 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-10 16:54:19 -0800
commit518425560a8b6ec7516505846c1b79623b467148 (patch)
tree4066f2658b9ab7160d66c93714485aa4dcc6a459 /fs/xfs/libxfs/xfs_da_format.c
parent3b34441309f364bba59a6ee5d1aa32206456142f (diff)
downloadlinux-518425560a8b6ec7516505846c1b79623b467148.tar.gz
linux-518425560a8b6ec7516505846c1b79623b467148.tar.bz2
linux-518425560a8b6ec7516505846c1b79623b467148.zip
xfs: devirtualize ->leaf_hdr_from_disk
Replace the ->leaf_hdr_from_disk dir ops method with a directly called xfs_dir2_leaf_hdr_from_disk helper that takes care of the differences between the v4 and v5 on-disk format. 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_da_format.c')
-rw-r--r--fs/xfs/libxfs/xfs_da_format.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/fs/xfs/libxfs/xfs_da_format.c b/fs/xfs/libxfs/xfs_da_format.c
index 68dff1de61e9..c848cab41be5 100644
--- a/fs/xfs/libxfs/xfs_da_format.c
+++ b/fs/xfs/libxfs/xfs_da_format.c
@@ -431,21 +431,6 @@ xfs_dir3_leaf_ents_p(struct xfs_dir2_leaf *lp)
}
static void
-xfs_dir2_leaf_hdr_from_disk(
- struct xfs_dir3_icleaf_hdr *to,
- struct xfs_dir2_leaf *from)
-{
- to->forw = be32_to_cpu(from->hdr.info.forw);
- to->back = be32_to_cpu(from->hdr.info.back);
- to->magic = be16_to_cpu(from->hdr.info.magic);
- to->count = be16_to_cpu(from->hdr.count);
- to->stale = be16_to_cpu(from->hdr.stale);
-
- ASSERT(to->magic == XFS_DIR2_LEAF1_MAGIC ||
- to->magic == XFS_DIR2_LEAFN_MAGIC);
-}
-
-static void
xfs_dir2_leaf_hdr_to_disk(
struct xfs_dir2_leaf *to,
struct xfs_dir3_icleaf_hdr *from)
@@ -461,23 +446,6 @@ xfs_dir2_leaf_hdr_to_disk(
}
static void
-xfs_dir3_leaf_hdr_from_disk(
- struct xfs_dir3_icleaf_hdr *to,
- struct xfs_dir2_leaf *from)
-{
- struct xfs_dir3_leaf_hdr *hdr3 = (struct xfs_dir3_leaf_hdr *)from;
-
- to->forw = be32_to_cpu(hdr3->info.hdr.forw);
- to->back = be32_to_cpu(hdr3->info.hdr.back);
- to->magic = be16_to_cpu(hdr3->info.hdr.magic);
- to->count = be16_to_cpu(hdr3->count);
- to->stale = be16_to_cpu(hdr3->stale);
-
- ASSERT(to->magic == XFS_DIR3_LEAF1_MAGIC ||
- to->magic == XFS_DIR3_LEAFN_MAGIC);
-}
-
-static void
xfs_dir3_leaf_hdr_to_disk(
struct xfs_dir2_leaf *to,
struct xfs_dir3_icleaf_hdr *from)
@@ -648,7 +616,6 @@ static const struct xfs_dir_ops xfs_dir2_ops = {
.leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr),
.leaf_hdr_to_disk = xfs_dir2_leaf_hdr_to_disk,
- .leaf_hdr_from_disk = xfs_dir2_leaf_hdr_from_disk,
.leaf_max_ents = xfs_dir2_max_leaf_ents,
.leaf_ents_p = xfs_dir2_leaf_ents_p,
@@ -693,7 +660,6 @@ static const struct xfs_dir_ops xfs_dir2_ftype_ops = {
.leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr),
.leaf_hdr_to_disk = xfs_dir2_leaf_hdr_to_disk,
- .leaf_hdr_from_disk = xfs_dir2_leaf_hdr_from_disk,
.leaf_max_ents = xfs_dir2_max_leaf_ents,
.leaf_ents_p = xfs_dir2_leaf_ents_p,
@@ -738,7 +704,6 @@ static const struct xfs_dir_ops xfs_dir3_ops = {
.leaf_hdr_size = sizeof(struct xfs_dir3_leaf_hdr),
.leaf_hdr_to_disk = xfs_dir3_leaf_hdr_to_disk,
- .leaf_hdr_from_disk = xfs_dir3_leaf_hdr_from_disk,
.leaf_max_ents = xfs_dir3_max_leaf_ents,
.leaf_ents_p = xfs_dir3_leaf_ents_p,