MINOR: server: create srv_was_usable() from srv_is_usable() and use a pointer

We used to call srv_is_usable() with either the current state and weights
or the previous ones. This causes trouble for future changes, so let's first
split it in two variants :
  - srv_is_usable(srv) considers the current status
  - srv_was_usable(srv) considers the previous status
diff --git a/include/proto/backend.h b/include/proto/backend.h
index 7af92e2..ac9e190 100644
--- a/include/proto/backend.h
+++ b/include/proto/backend.h
@@ -52,12 +52,30 @@
 	be->be_counters.last_sess = now.tv_sec;
 }
 
-/* This function returns non-zero if a server with the given weight and state
- * is usable for LB, otherwise zero.
+/* This function returns non-zero if the designated server is usable for LB
+ * according to its current weight and current state. Otherwise it returns 0.
  */
-static inline int srv_is_usable(int state, int weight)
+static inline int srv_is_usable(const struct server *srv)
+{
+	int state = srv->state;
+
+	if (!srv->eweight)
+		return 0;
+	if (state & (SRV_GOINGDOWN | SRV_MAINTAIN))
+		return 0;
+	if (!(state & SRV_RUNNING))
+		return 0;
+	return 1;
+}
+
+/* This function returns non-zero if the designated server was usable for LB
+ * according to its current weight and previous state. Otherwise it returns 0.
+ */
+static inline int srv_was_usable(const struct server *srv)
 {
-	if (!weight)
+	int state = srv->prev_state;
+
+	if (!srv->prev_eweight)
 		return 0;
 	if (state & (SRV_GOINGDOWN | SRV_MAINTAIN))
 		return 0;