ocfs2/trivial: Code cleanup for allocation reservation.
authorTao Ma <tao.ma@oracle.com>
Tue, 6 Apr 2010 08:46:46 +0000 (16:46 +0800)
committerJoel Becker <joel.becker@oracle.com>
Thu, 6 May 2010 01:18:09 +0000 (18:18 -0700)
Two tiny cleanup for allocation reservation.
1. Remove some extra codes in ocfs2_local_alloc_find_clear_bits.
2. Remove an unuseful variables in ocfs2_find_resv_lhs.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Acked-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/localalloc.c
fs/ocfs2/reservations.c

index 00022aac2e8cf709d8d16a2da63d00b7c63ba42b..63c41e206792a1886024e19930aa47041f06aef0 100644 (file)
@@ -879,13 +879,10 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb,
        mlog(0, "Exiting loop, bitoff = %d, numfound = %d\n", bitoff,
             numfound);
 
-       if (numfound == *numbits) {
+       if (numfound == *numbits)
                bitoff = startoff - numfound;
-               *numbits = numfound;
-       } else {
-               numfound = 0;
+       else
                bitoff = -1;
-       }
 
 bail:
        if (local_resv)
index cb813ef98846c6fb6962c623ae25da487779811a..40650021fc24f633deb020ec10b26492315c27f9 100644 (file)
@@ -371,7 +371,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal)
        struct ocfs2_alloc_reservation *resv = NULL;
        struct ocfs2_alloc_reservation *prev_resv = NULL;
        struct rb_node *node = resmap->m_reservations.rb_node;
-       struct rb_node *prev = NULL;
 
        assert_spin_locked(&resv_lock);
 
@@ -392,7 +391,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal)
                }
 
                prev_resv = resv;
-               prev = node;
                node = rb_next(node);
        }