Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: create a separate finobt verifier

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>

authored by

Brian Foster and committed by
Darrick J. Wong
01e68f40 e34d3e74

+15 -5
+1 -1
fs/xfs/libxfs/xfs_ag.c
··· 361 361 { /* FINO root block */ 362 362 .daddr = XFS_AGB_TO_DADDR(mp, id->agno, XFS_FIBT_BLOCK(mp)), 363 363 .numblks = BTOBB(mp->m_sb.sb_blocksize), 364 - .ops = &xfs_inobt_buf_ops, 364 + .ops = &xfs_finobt_buf_ops, 365 365 .work = &xfs_btroot_init, 366 366 .type = XFS_BTNUM_FINO, 367 367 .need_init = xfs_sb_version_hasfinobt(&mp->m_sb)
+8 -1
fs/xfs/libxfs/xfs_ialloc_btree.c
··· 333 333 .verify_struct = xfs_inobt_verify, 334 334 }; 335 335 336 + const struct xfs_buf_ops xfs_finobt_buf_ops = { 337 + .name = "xfs_finobt", 338 + .verify_read = xfs_inobt_read_verify, 339 + .verify_write = xfs_inobt_write_verify, 340 + .verify_struct = xfs_inobt_verify, 341 + }; 342 + 336 343 STATIC int 337 344 xfs_inobt_keys_inorder( 338 345 struct xfs_btree_cur *cur, ··· 396 389 .init_rec_from_cur = xfs_inobt_init_rec_from_cur, 397 390 .init_ptr_from_cur = xfs_finobt_init_ptr_from_cur, 398 391 .key_diff = xfs_inobt_key_diff, 399 - .buf_ops = &xfs_inobt_buf_ops, 392 + .buf_ops = &xfs_finobt_buf_ops, 400 393 .diff_two_keys = xfs_inobt_diff_two_keys, 401 394 .keys_inorder = xfs_inobt_keys_inorder, 402 395 .recs_inorder = xfs_inobt_recs_inorder,
+1
fs/xfs/libxfs/xfs_shared.h
··· 36 36 extern const struct xfs_buf_ops xfs_symlink_buf_ops; 37 37 extern const struct xfs_buf_ops xfs_agi_buf_ops; 38 38 extern const struct xfs_buf_ops xfs_inobt_buf_ops; 39 + extern const struct xfs_buf_ops xfs_finobt_buf_ops; 39 40 extern const struct xfs_buf_ops xfs_inode_buf_ops; 40 41 extern const struct xfs_buf_ops xfs_inode_buf_ra_ops; 41 42 extern const struct xfs_buf_ops xfs_dquot_buf_ops;
+1 -1
fs/xfs/scrub/agheader_repair.c
··· 879 879 }, 880 880 [XREP_AGI_FINOBT] = { 881 881 .rmap_owner = XFS_RMAP_OWN_INOBT, 882 - .buf_ops = &xfs_inobt_buf_ops, 882 + .buf_ops = &xfs_finobt_buf_ops, 883 883 .magic = XFS_FIBT_CRC_MAGIC, 884 884 }, 885 885 [XREP_AGI_END] = {
+4 -2
fs/xfs/xfs_log_recover.c
··· 2445 2445 bp->b_ops = &xfs_allocbt_buf_ops; 2446 2446 break; 2447 2447 case XFS_IBT_CRC_MAGIC: 2448 - case XFS_FIBT_CRC_MAGIC: 2449 2448 case XFS_IBT_MAGIC: 2450 - case XFS_FIBT_MAGIC: 2451 2449 bp->b_ops = &xfs_inobt_buf_ops; 2450 + break; 2451 + case XFS_FIBT_CRC_MAGIC: 2452 + case XFS_FIBT_MAGIC: 2453 + bp->b_ops = &xfs_finobt_buf_ops; 2452 2454 break; 2453 2455 case XFS_BMAP_CRC_MAGIC: 2454 2456 case XFS_BMAP_MAGIC: