]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
xfs: create a separate finobt verifier
authorBrian Foster <bfoster@redhat.com>
Thu, 7 Feb 2019 18:45:46 +0000 (10:45 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 12 Feb 2019 00:07:01 +0000 (16:07 -0800)
The inobt verifier is reused for the inobt and finobt, which
prevents the ability to distinguish between magic values on a
per-tree basis. Create a separate finobt structure in preparation
for changes to enforce the appropriate magic value for the
associated tree. This patch has no functional change.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_ag.c
fs/xfs/libxfs/xfs_ialloc_btree.c
fs/xfs/libxfs/xfs_shared.h
fs/xfs/scrub/agheader_repair.c
fs/xfs/xfs_log_recover.c

index 999ad8d00d433b278554e7df259c076dec95f14e..bde67ef3ff436a33e2ea6bc8eba202c853223c0d 100644 (file)
@@ -361,7 +361,7 @@ xfs_ag_init_headers(
        { /* FINO root block */
                .daddr = XFS_AGB_TO_DADDR(mp, id->agno, XFS_FIBT_BLOCK(mp)),
                .numblks = BTOBB(mp->m_sb.sb_blocksize),
-               .ops = &xfs_inobt_buf_ops,
+               .ops = &xfs_finobt_buf_ops,
                .work = &xfs_btroot_init,
                .type = XFS_BTNUM_FINO,
                .need_init =  xfs_sb_version_hasfinobt(&mp->m_sb)
index 9b25e7a0df470b6e5552d7e841a74082681a8cf8..798269eb4767efe6def17c45b6336d3e58d4f4c9 100644 (file)
@@ -333,6 +333,13 @@ const struct xfs_buf_ops xfs_inobt_buf_ops = {
        .verify_struct = xfs_inobt_verify,
 };
 
+const struct xfs_buf_ops xfs_finobt_buf_ops = {
+       .name = "xfs_finobt",
+       .verify_read = xfs_inobt_read_verify,
+       .verify_write = xfs_inobt_write_verify,
+       .verify_struct = xfs_inobt_verify,
+};
+
 STATIC int
 xfs_inobt_keys_inorder(
        struct xfs_btree_cur    *cur,
@@ -389,7 +396,7 @@ static const struct xfs_btree_ops xfs_finobt_ops = {
        .init_rec_from_cur      = xfs_inobt_init_rec_from_cur,
        .init_ptr_from_cur      = xfs_finobt_init_ptr_from_cur,
        .key_diff               = xfs_inobt_key_diff,
-       .buf_ops                = &xfs_inobt_buf_ops,
+       .buf_ops                = &xfs_finobt_buf_ops,
        .diff_two_keys          = xfs_inobt_diff_two_keys,
        .keys_inorder           = xfs_inobt_keys_inorder,
        .recs_inorder           = xfs_inobt_recs_inorder,
index 1c5debe748f0aca5431fa45daf7fbc078270378e..9855f4d2f98fe4dcea5c36b2e3fd403c5235f9f3 100644 (file)
@@ -36,6 +36,7 @@ extern const struct xfs_buf_ops xfs_dquot_buf_ops;
 extern const struct xfs_buf_ops xfs_symlink_buf_ops;
 extern const struct xfs_buf_ops xfs_agi_buf_ops;
 extern const struct xfs_buf_ops xfs_inobt_buf_ops;
+extern const struct xfs_buf_ops xfs_finobt_buf_ops;
 extern const struct xfs_buf_ops xfs_inode_buf_ops;
 extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
 extern const struct xfs_buf_ops xfs_dquot_buf_ops;
index 03d1e15ccebaa3364226a9985955d224cf9724a7..673be3cf7b8d53b52d5109a1fed8ceca4ec43fe5 100644 (file)
@@ -879,7 +879,7 @@ xrep_agi(
                },
                [XREP_AGI_FINOBT] = {
                        .rmap_owner = XFS_RMAP_OWN_INOBT,
-                       .buf_ops = &xfs_inobt_buf_ops,
+                       .buf_ops = &xfs_finobt_buf_ops,
                        .magic = XFS_FIBT_CRC_MAGIC,
                },
                [XREP_AGI_END] = {
index 9fe88d125f0a2b78b9c433618df44be9fcecfa98..228c754bb13736645fa33ab1b539d98d59cc6826 100644 (file)
@@ -2445,11 +2445,13 @@ xlog_recover_validate_buf_type(
                        bp->b_ops = &xfs_allocbt_buf_ops;
                        break;
                case XFS_IBT_CRC_MAGIC:
-               case XFS_FIBT_CRC_MAGIC:
                case XFS_IBT_MAGIC:
-               case XFS_FIBT_MAGIC:
                        bp->b_ops = &xfs_inobt_buf_ops;
                        break;
+               case XFS_FIBT_CRC_MAGIC:
+               case XFS_FIBT_MAGIC:
+                       bp->b_ops = &xfs_finobt_buf_ops;
+                       break;
                case XFS_BMAP_CRC_MAGIC:
                case XFS_BMAP_MAGIC:
                        bp->b_ops = &xfs_bmbt_buf_ops;