summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/trans.h')
-rw-r--r--fs/gfs2/trans.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/gfs2/trans.h b/fs/gfs2/trans.h
index 1e6e7da25a17..ad70087d0597 100644
--- a/fs/gfs2/trans.h
+++ b/fs/gfs2/trans.h
@@ -30,9 +30,11 @@ struct gfs2_glock;
* block, or all of the blocks in the rg, whichever is smaller */
static inline unsigned int gfs2_rg_blocks(const struct gfs2_inode *ip, unsigned requested)
{
- if (requested < ip->i_rgd->rd_length)
+ struct gfs2_rgrpd *rgd = ip->i_res.rs_rbm.rgd;
+
+ if (requested < rgd->rd_length)
return requested + 1;
- return ip->i_rgd->rd_length;
+ return rgd->rd_length;
}
extern int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,