diff options
author | Christoph Hellwig <hch@lst.de> | 2019-11-08 14:57:48 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-10 16:54:19 -0800 |
commit | e1c8af1e02c7893f2d056aa44c4daf59fe0881ed (patch) | |
tree | c3f4fd8970d9410b5b33ba8d20e802ab7b5a61a3 /fs/xfs/libxfs/xfs_da_format.c | |
parent | f475dc4dc7cc98ad653135db174084a55076b1ba (diff) | |
download | linux-e1c8af1e02c7893f2d056aa44c4daf59fe0881ed.tar.gz linux-e1c8af1e02c7893f2d056aa44c4daf59fe0881ed.tar.bz2 linux-e1c8af1e02c7893f2d056aa44c4daf59fe0881ed.zip |
xfs: devirtualize ->node_hdr_to_disk
Replace the ->node_hdr_to_disk dir ops method with a directly called
xfs_da_node_hdr_to_disk helper that takes care of the v4 vs v5
difference.
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.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/fs/xfs/libxfs/xfs_da_format.c b/fs/xfs/libxfs/xfs_da_format.c index 267aca857126..912096416a86 100644 --- a/fs/xfs/libxfs/xfs_da_format.c +++ b/fs/xfs/libxfs/xfs_da_format.c @@ -510,35 +510,6 @@ xfs_da3_node_tree_p(struct xfs_da_intnode *dap) return ((struct xfs_da3_intnode *)dap)->__btree; } -static void -xfs_da2_node_hdr_to_disk( - struct xfs_da_intnode *to, - struct xfs_da3_icnode_hdr *from) -{ - ASSERT(from->magic == XFS_DA_NODE_MAGIC); - to->hdr.info.forw = cpu_to_be32(from->forw); - to->hdr.info.back = cpu_to_be32(from->back); - to->hdr.info.magic = cpu_to_be16(from->magic); - to->hdr.__count = cpu_to_be16(from->count); - to->hdr.__level = cpu_to_be16(from->level); -} - -static void -xfs_da3_node_hdr_to_disk( - struct xfs_da_intnode *to, - struct xfs_da3_icnode_hdr *from) -{ - struct xfs_da3_node_hdr *hdr3 = (struct xfs_da3_node_hdr *)to; - - ASSERT(from->magic == XFS_DA3_NODE_MAGIC); - hdr3->info.hdr.forw = cpu_to_be32(from->forw); - hdr3->info.hdr.back = cpu_to_be32(from->back); - hdr3->info.hdr.magic = cpu_to_be16(from->magic); - hdr3->__count = cpu_to_be16(from->count); - hdr3->__level = cpu_to_be16(from->level); -} - - /* * Directory free space block operations */ @@ -698,7 +669,6 @@ static const struct xfs_dir_ops xfs_dir2_ops = { .leaf_ents_p = xfs_dir2_leaf_ents_p, .node_hdr_size = sizeof(struct xfs_da_node_hdr), - .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_tree_p = xfs_da2_node_tree_p, .free_hdr_size = sizeof(struct xfs_dir2_free_hdr), @@ -747,7 +717,6 @@ static const struct xfs_dir_ops xfs_dir2_ftype_ops = { .leaf_ents_p = xfs_dir2_leaf_ents_p, .node_hdr_size = sizeof(struct xfs_da_node_hdr), - .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_tree_p = xfs_da2_node_tree_p, .free_hdr_size = sizeof(struct xfs_dir2_free_hdr), @@ -796,7 +765,6 @@ static const struct xfs_dir_ops xfs_dir3_ops = { .leaf_ents_p = xfs_dir3_leaf_ents_p, .node_hdr_size = sizeof(struct xfs_da3_node_hdr), - .node_hdr_to_disk = xfs_da3_node_hdr_to_disk, .node_tree_p = xfs_da3_node_tree_p, .free_hdr_size = sizeof(struct xfs_dir3_free_hdr), @@ -810,13 +778,11 @@ static const struct xfs_dir_ops xfs_dir3_ops = { static const struct xfs_dir_ops xfs_dir2_nondir_ops = { .node_hdr_size = sizeof(struct xfs_da_node_hdr), - .node_hdr_to_disk = xfs_da2_node_hdr_to_disk, .node_tree_p = xfs_da2_node_tree_p, }; static const struct xfs_dir_ops xfs_dir3_nondir_ops = { .node_hdr_size = sizeof(struct xfs_da3_node_hdr), - .node_hdr_to_disk = xfs_da3_node_hdr_to_disk, .node_tree_p = xfs_da3_node_tree_p, }; |