aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index a9b95d9cf2ad..7c6d9acd7154 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -2629,14 +2629,12 @@ xfs_bmap_btalloc(
2629 if (startag == NULLAGNUMBER) 2629 if (startag == NULLAGNUMBER)
2630 startag = ag = 0; 2630 startag = ag = 0;
2631 notinit = 0; 2631 notinit = 0;
2632 down_read(&mp->m_peraglock);
2633 pag = xfs_perag_get(mp, ag); 2632 pag = xfs_perag_get(mp, ag);
2634 while (blen < ap->alen) { 2633 while (blen < ap->alen) {
2635 if (!pag->pagf_init && 2634 if (!pag->pagf_init &&
2636 (error = xfs_alloc_pagf_init(mp, args.tp, 2635 (error = xfs_alloc_pagf_init(mp, args.tp,
2637 ag, XFS_ALLOC_FLAG_TRYLOCK))) { 2636 ag, XFS_ALLOC_FLAG_TRYLOCK))) {
2638 xfs_perag_put(pag); 2637 xfs_perag_put(pag);
2639 up_read(&mp->m_peraglock);
2640 return error; 2638 return error;
2641 } 2639 }
2642 /* 2640 /*
@@ -2669,10 +2667,8 @@ xfs_bmap_btalloc(
2669 2667
2670 error = xfs_filestream_new_ag(ap, &ag); 2668 error = xfs_filestream_new_ag(ap, &ag);
2671 xfs_perag_put(pag); 2669 xfs_perag_put(pag);
2672 if (error) { 2670 if (error)
2673 up_read(&mp->m_peraglock);
2674 return error; 2671 return error;
2675 }
2676 2672
2677 /* loop again to set 'blen'*/ 2673 /* loop again to set 'blen'*/
2678 startag = NULLAGNUMBER; 2674 startag = NULLAGNUMBER;
@@ -2688,7 +2684,6 @@ xfs_bmap_btalloc(
2688 pag = xfs_perag_get(mp, ag); 2684 pag = xfs_perag_get(mp, ag);
2689 } 2685 }
2690 xfs_perag_put(pag); 2686 xfs_perag_put(pag);
2691 up_read(&mp->m_peraglock);
2692 /* 2687 /*
2693 * Since the above loop did a BUF_TRYLOCK, it is 2688 * Since the above loop did a BUF_TRYLOCK, it is
2694 * possible that there is space for this request. 2689 * possible that there is space for this request.