Commit 3e4218df authored by Tao Ma's avatar Tao Ma Committed by Joel Becker

ocfs2/trivial: Code cleanup for allocation reservation.

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: default avatarTao Ma <tao.ma@oracle.com>
Acked-by: default avatarMark Fasheh <mfasheh@suse.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent b065556a
...@@ -879,13 +879,10 @@ static int ocfs2_local_alloc_find_clear_bits(struct ocfs2_super *osb, ...@@ -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, mlog(0, "Exiting loop, bitoff = %d, numfound = %d\n", bitoff,
numfound); numfound);
if (numfound == *numbits) { if (numfound == *numbits)
bitoff = startoff - numfound; bitoff = startoff - numfound;
*numbits = numfound; else
} else {
numfound = 0;
bitoff = -1; bitoff = -1;
}
bail: bail:
if (local_resv) if (local_resv)
......
...@@ -371,7 +371,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal) ...@@ -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 *resv = NULL;
struct ocfs2_alloc_reservation *prev_resv = NULL; struct ocfs2_alloc_reservation *prev_resv = NULL;
struct rb_node *node = resmap->m_reservations.rb_node; struct rb_node *node = resmap->m_reservations.rb_node;
struct rb_node *prev = NULL;
assert_spin_locked(&resv_lock); assert_spin_locked(&resv_lock);
...@@ -392,7 +391,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal) ...@@ -392,7 +391,6 @@ ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal)
} }
prev_resv = resv; prev_resv = resv;
prev = node;
node = rb_next(node); node = rb_next(node);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment