Skip to contentSkip to conversation

ocfs2/trivial: Code cleanup for allocation reservation.

PATCH New Tao Ma 3 participants 3 messages Apr 6, 2010 – Apr 26, 2010 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 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.

Cc Mark Fasheh <[email protected]>
---
 fs/ocfs2/localalloc.c   |    7 ++-----
 fs/ocfs2/reservations.c |    2 --
 2 files changed, 2 insertions(+), 7 deletions(-)
fs/ocfs2/localalloc.c +2 -5
index 2882f79..0b32113 100644
@@ -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)
fs/ocfs2/reservations.c +0 -2
index 6497bcc..32bad4a 100644
@@ -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);
 	}
 
Signature · 1 line
1.5.5
#2 lore raw

PATCH 1/1 ocfs2/trivial: Code cleanup for allocation reservation.

In reply to Tao Ma
Quoted 6 lines · Tao Ma

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.

Cc Mark Fasheh <[email protected]>

This is now in the 'merge-window' branch of ocfs2.git.

Joel

Signature · 8 lines
"Against stupidity the Gods themselves contend in vain."
	- Friedrich von Schiller

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127