summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_ialloc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-09-05 07:17:31 (GMT)
committerTakashi Iwai <tiwai@suse.de>2012-09-05 07:17:31 (GMT)
commit14e42917216ab0859827c2d8024df45a917301b4 (patch)
treeefbea5d1c54387d62a6fd66a21560232cf312fda /fs/xfs/xfs_ialloc.c
parent292f2b6254c9dbb98def6d3521b07a837545ead0 (diff)
parent4266274836e81575ee82498d84f4bd08ab7a7378 (diff)
downloadlinux-fsl-qoriq-14e42917216ab0859827c2d8024df45a917301b4.tar.xz
Merge branch 'fixes' of git://git.alsa-project.org/alsa-kernel into for-next
Diffstat (limited to 'fs/xfs/xfs_ialloc.c')
-rw-r--r--fs/xfs/xfs_ialloc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 21e37b5..5aceb3f 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -962,23 +962,22 @@ xfs_dialloc(
if (!pag->pagi_freecount && !okalloc)
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);
if (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) {
xfs_perag_put(pag);
goto out_alloc;
}
- if (!okalloc) {
- xfs_trans_brelse(tp, agbp);
- goto nextag;
- }
+ if (!okalloc)
+ goto nextag_relse_buffer;
+
error = xfs_ialloc_ag_alloc(tp, agbp, &ialloced);
if (error) {
@@ -1007,6 +1006,8 @@ xfs_dialloc(
return 0;
}
+nextag_relse_buffer:
+ xfs_trans_brelse(tp, agbp);
nextag:
xfs_perag_put(pag);
if (++agno == mp->m_sb.sb_agcount)