mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-09 07:38:00 +07:00
xfs: unlock the AGI buffer when looping in xfs_dialloc
Also update some commens in the area to make the code easier to read. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
This commit is contained in:
parent
1ed845df60
commit
c4982110ae
@ -962,23 +962,22 @@ xfs_dialloc(
|
|||||||
if (!pag->pagi_freecount && !okalloc)
|
if (!pag->pagi_freecount && !okalloc)
|
||||||
goto nextag;
|
goto nextag;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Then read in the AGI buffer and recheck with the AGI buffer
|
||||||
|
* lock held.
|
||||||
|
*/
|
||||||
error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
|
error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_error;
|
goto out_error;
|
||||||
|
|
||||||
/*
|
|
||||||
* Once the AGI has been read in we have to recheck
|
|
||||||
* pagi_freecount with the AGI buffer lock held.
|
|
||||||
*/
|
|
||||||
if (pag->pagi_freecount) {
|
if (pag->pagi_freecount) {
|
||||||
xfs_perag_put(pag);
|
xfs_perag_put(pag);
|
||||||
goto out_alloc;
|
goto out_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!okalloc) {
|
if (!okalloc)
|
||||||
xfs_trans_brelse(tp, agbp);
|
goto nextag_relse_buffer;
|
||||||
goto nextag;
|
|
||||||
}
|
|
||||||
|
|
||||||
error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced);
|
error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced);
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -1007,6 +1006,8 @@ xfs_dialloc(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nextag_relse_buffer:
|
||||||
|
xfs_trans_brelse(tp, agbp);
|
||||||
nextag:
|
nextag:
|
||||||
xfs_perag_put(pag);
|
xfs_perag_put(pag);
|
||||||
if (++agno == mp->m_sb.sb_agcount)
|
if (++agno == mp->m_sb.sb_agcount)
|
||||||
|
Loading…
Reference in New Issue
Block a user