summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2014-10-29 08:02:30 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2014-11-03 19:26:54 +0000
commit1a8550332a7f0111306b6b34e44a7c696ef68c4d (patch)
tree030b657ece5e651d86e27065107a79b416d89ec8 /fs/gfs2/rgrp.c
parent33ad5d54284adf110f6e78aa9c4f42d3d17d7f68 (diff)
downloadop-kernel-dev-1a8550332a7f0111306b6b34e44a7c696ef68c4d.zip
op-kernel-dev-1a8550332a7f0111306b6b34e44a7c696ef68c4d.tar.gz
GFS2: If we use up our block reservation, request more next time
If we run out of blocks for a given multi-block allocation, we obviously did not reserve enough. We should reserve more blocks for the next reservation to reduce fragmentation. This patch increases the size hint for reservations when they run out. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index f4e4a0c..9150207 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2251,6 +2251,9 @@ static void gfs2_adjust_reservation(struct gfs2_inode *ip,
trace_gfs2_rs(rs, TRACE_RS_CLAIM);
if (rs->rs_free && !ret)
goto out;
+ /* We used up our block reservation, so we should
+ reserve more blocks next time. */
+ atomic_add(RGRP_RSRV_ADDBLKS, &rs->rs_sizehint);
}
__rs_deltree(rs);
}
OpenPOWER on IntegriCloud