[Sheepdog] [PATCH v2 08/10] sheep: add end_recover() hook to store.

Liu Yuan namei.unix at gmail.com
Thu Dec 22 07:52:41 CET 2011


From: Liu Yuan <tailai.ly at taobao.com>

We need to notify underlying store when the recovery ends.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/sheep_priv.h |    1 +
 sheep/store.c      |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index aee865d..8a85db5 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -177,6 +177,7 @@ struct store_driver {
 	int (*link)(uint64_t oid, struct siocb *, int tgt_epoch);
 	int (*atomic_put)(uint64_t oid, struct siocb *);
 	int (*begin_recover)(struct siocb *);
+	int (*end_recover)(struct siocb *);
 };
 
 extern void register_store_driver(struct store_driver *);
diff --git a/sheep/store.c b/sheep/store.c
index 3d92a0d..392248a 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -1568,6 +1568,11 @@ static void recover_done(struct work *work, int idx)
 
 		recovering_work = rw;
 		queue_work(sys->recovery_wqueue, &rw->work);
+	} else {
+		if (store.end_recover) {
+			struct siocb iocb;
+			store.end_recover(&iocb);
+		}
 	}
 
 	resume_pending_requests();
-- 
1.7.8.rc3




More information about the sheepdog mailing list