aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 8d9c08b5c4b6..1727f5012efe 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -27,6 +27,7 @@
27#include "trans.h" 27#include "trans.h"
28#include "ops_file.h" 28#include "ops_file.h"
29#include "util.h" 29#include "util.h"
30#include "log.h"
30 31
31#define BFITNOENT ((u32)~0) 32#define BFITNOENT ((u32)~0)
32 33
@@ -697,8 +698,6 @@ struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip)
697 * @al: the struct gfs2_alloc structure describing the reservation 698 * @al: the struct gfs2_alloc structure describing the reservation
698 * 699 *
699 * If there's room for the requested blocks to be allocated from the RG: 700 * If there's room for the requested blocks to be allocated from the RG:
700 * Sets the $al_reserved_data field in @al.
701 * Sets the $al_reserved_meta field in @al.
702 * Sets the $al_rgd field in @al. 701 * Sets the $al_rgd field in @al.
703 * 702 *
704 * Returns: 1 on success (it fits), 0 on failure (it doesn't fit) 703 * Returns: 1 on success (it fits), 0 on failure (it doesn't fit)
@@ -709,6 +708,9 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al)
709 struct gfs2_sbd *sdp = rgd->rd_sbd; 708 struct gfs2_sbd *sdp = rgd->rd_sbd;
710 int ret = 0; 709 int ret = 0;
711 710
711 if (rgd->rd_rg.rg_flags & GFS2_RGF_NOALLOC)
712 return 0;
713
712 spin_lock(&sdp->sd_rindex_spin); 714 spin_lock(&sdp->sd_rindex_spin);
713 if (rgd->rd_free_clone >= al->al_requested) { 715 if (rgd->rd_free_clone >= al->al_requested) {
714 al->al_rgd = rgd; 716 al->al_rgd = rgd;
@@ -941,9 +943,13 @@ static int get_local_rgrp(struct gfs2_inode *ip)
941 rgd = gfs2_rgrpd_get_first(sdp); 943 rgd = gfs2_rgrpd_get_first(sdp);
942 944
943 if (rgd == begin) { 945 if (rgd == begin) {
944 if (++loops >= 2 || !skipped) 946 if (++loops >= 3)
945 return -ENOSPC; 947 return -ENOSPC;
948 if (!skipped)
949 loops++;
946 flags = 0; 950 flags = 0;
951 if (loops == 2)
952 gfs2_log_flush(sdp, NULL);
947 } 953 }
948 } 954 }
949 955