aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/rgrp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 8ec41744594..1daf8a78c73 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -329,17 +329,16 @@ static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block)
329 329
330struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk) 330struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk)
331{ 331{
332 struct rb_node **newn, *parent = NULL; 332 struct rb_node **newn;
333 struct gfs2_rgrpd *cur;
333 334
334 spin_lock(&sdp->sd_rindex_spin); 335 spin_lock(&sdp->sd_rindex_spin);
335 newn = &sdp->sd_rindex_tree.rb_node; 336 newn = &sdp->sd_rindex_tree.rb_node;
336 while (*newn) { 337 while (*newn) {
337 struct gfs2_rgrpd *cur = rb_entry(*newn, struct gfs2_rgrpd, 338 cur = rb_entry(*newn, struct gfs2_rgrpd, rd_node);
338 rd_node);
339 parent = *newn;
340 if (blk < cur->rd_addr) 339 if (blk < cur->rd_addr)
341 newn = &((*newn)->rb_left); 340 newn = &((*newn)->rb_left);
342 else if (blk > cur->rd_data0 + cur->rd_data) 341 else if (blk >= cur->rd_data0 + cur->rd_data)
343 newn = &((*newn)->rb_right); 342 newn = &((*newn)->rb_right);
344 else { 343 else {
345 spin_unlock(&sdp->sd_rindex_spin); 344 spin_unlock(&sdp->sd_rindex_spin);