diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-30 01:37:08 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-30 01:37:08 -0400 |
commit | ebcbef3a61a6081ffe20b0b684f18ebbf23f1dfb (patch) | |
tree | d9b30678acfa6dc5e99944a4e7dc5fca6f09f2a9 /fs/xfs/libxfs/xfs_ialloc_btree.c | |
parent | 1c02d502c20809a2a5f71ec16a930a61ed779b81 (diff) |
xfs: pass transaction lock while setting up agresv on cyclic metadata
Pass a tranaction pointer through to all helpers that calculate the
per-AG block reservation. Online repair will use this to reinitialize
per-ag reservations while it still holds all the AG headers locked to
the repair transaction.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_ialloc_btree.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c index 735a33252eb2..86c50208a143 100644 --- a/fs/xfs/libxfs/xfs_ialloc_btree.c +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c | |||
@@ -552,6 +552,7 @@ xfs_inobt_max_size( | |||
552 | static int | 552 | static int |
553 | xfs_inobt_count_blocks( | 553 | xfs_inobt_count_blocks( |
554 | struct xfs_mount *mp, | 554 | struct xfs_mount *mp, |
555 | struct xfs_trans *tp, | ||
555 | xfs_agnumber_t agno, | 556 | xfs_agnumber_t agno, |
556 | xfs_btnum_t btnum, | 557 | xfs_btnum_t btnum, |
557 | xfs_extlen_t *tree_blocks) | 558 | xfs_extlen_t *tree_blocks) |
@@ -560,14 +561,14 @@ xfs_inobt_count_blocks( | |||
560 | struct xfs_btree_cur *cur; | 561 | struct xfs_btree_cur *cur; |
561 | int error; | 562 | int error; |
562 | 563 | ||
563 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); | 564 | error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); |
564 | if (error) | 565 | if (error) |
565 | return error; | 566 | return error; |
566 | 567 | ||
567 | cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno, btnum); | 568 | cur = xfs_inobt_init_cursor(mp, tp, agbp, agno, btnum); |
568 | error = xfs_btree_count_blocks(cur, tree_blocks); | 569 | error = xfs_btree_count_blocks(cur, tree_blocks); |
569 | xfs_btree_del_cursor(cur, error); | 570 | xfs_btree_del_cursor(cur, error); |
570 | xfs_buf_relse(agbp); | 571 | xfs_trans_brelse(tp, agbp); |
571 | 572 | ||
572 | return error; | 573 | return error; |
573 | } | 574 | } |
@@ -578,6 +579,7 @@ xfs_inobt_count_blocks( | |||
578 | int | 579 | int |
579 | xfs_finobt_calc_reserves( | 580 | xfs_finobt_calc_reserves( |
580 | struct xfs_mount *mp, | 581 | struct xfs_mount *mp, |
582 | struct xfs_trans *tp, | ||
581 | xfs_agnumber_t agno, | 583 | xfs_agnumber_t agno, |
582 | xfs_extlen_t *ask, | 584 | xfs_extlen_t *ask, |
583 | xfs_extlen_t *used) | 585 | xfs_extlen_t *used) |
@@ -588,7 +590,7 @@ xfs_finobt_calc_reserves( | |||
588 | if (!xfs_sb_version_hasfinobt(&mp->m_sb)) | 590 | if (!xfs_sb_version_hasfinobt(&mp->m_sb)) |
589 | return 0; | 591 | return 0; |
590 | 592 | ||
591 | error = xfs_inobt_count_blocks(mp, agno, XFS_BTNUM_FINO, &tree_len); | 593 | error = xfs_inobt_count_blocks(mp, tp, agno, XFS_BTNUM_FINO, &tree_len); |
592 | if (error) | 594 | if (error) |
593 | return error; | 595 | return error; |
594 | 596 | ||