diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2010-09-27 17:00:04 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-09-28 04:44:24 -0400 |
commit | bf97b6734e027cc18abad420ab88f861f65d7816 (patch) | |
tree | 74892640ed482487f3bc630ad4fd20e62dec2c54 /fs/gfs2/trans.h | |
parent | d0795f912318f65b800c6b619d749c3bf7c930fb (diff) |
GFS2: reserve more blocks for transactions
Some of the functions in GFS2 were not reserving space in the transaction for
the resource group header and the resource groups bitblocks that get added
when you do allocation. GFS2 now makes sure to reserve space for the
resource group header and either all the bitblocks in the resource group, or
one for each block that it may allocate, whichever is smaller using the new
gfs2_rg_blocks() inline function.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/trans.h')
-rw-r--r-- | fs/gfs2/trans.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/gfs2/trans.h b/fs/gfs2/trans.h index b849eb7ad37d..fb56b783e028 100644 --- a/fs/gfs2/trans.h +++ b/fs/gfs2/trans.h | |||
@@ -26,6 +26,14 @@ struct gfs2_glock; | |||
26 | #define RES_STATFS 1 | 26 | #define RES_STATFS 1 |
27 | #define RES_QUOTA 2 | 27 | #define RES_QUOTA 2 |
28 | 28 | ||
29 | /* reserve either the number of blocks to be allocated plus the rg header | ||
30 | * block, or all of the blocks in the rg, whichever is smaller */ | ||
31 | static inline unsigned int gfs2_rg_blocks(const struct gfs2_alloc *al) | ||
32 | { | ||
33 | return (al->al_requested < al->al_rgd->rd_length)? | ||
34 | al->al_requested + 1 : al->al_rgd->rd_length; | ||
35 | } | ||
36 | |||
29 | int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, | 37 | int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks, |
30 | unsigned int revokes); | 38 | unsigned int revokes); |
31 | 39 | ||