From: Liu Yuan <[email protected]>

We are now passing CREATE request directly to backend store, so no need to
check newly created oid in oid_in_recovery(). This will boost recovery
performance a bit.

Signed-off-by: Liu Yuan <[email protected]>
---
 sheep/recovery.c |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 59ac9d6..769f718 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -280,10 +280,10 @@ static inline void prepare_schedule_oid(uint64_t oid)
        dprintf("%"PRIx64" nr_prio_oids %d\n", oid, rw->nr_prio_oids);
 }
 
+/* Try schedule requested object if not recovered yet and in RW_RUN state */
 bool oid_in_recovery(uint64_t oid)
 {
        struct recovery_work *rw = recovering_work;
-       int i;
 
        if (!node_in_recovery())
                return false;
@@ -300,20 +300,6 @@ bool oid_in_recovery(uint64_t oid)
        if (rw->state == RW_INIT)
                return true;
 
-       /* FIXME: do we need more efficient yet complex data structure? */
-       for (i = rw->done - 1; i < rw->count; i++)
-               if (rw->oids[i] == oid)
-                       break;
-
-       /*
-        * Newly created object after prepare_object_list() might not be
-        * in the list
-        */
-       if (i == rw->count) {
-               eprintf("%"PRIx64" is not in the recovery list\n", oid);
-               return false;
-       }
-
        prepare_schedule_oid(oid);
        return true;
 }
-- 
1.7.10.2

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to