[Sheepdog] [PATCH v6 11/17] sheep: add end_recover() hook to store.

Liu Yuan namei.unix at gmail.com
Thu Jan 12 14:37:22 CET 2012


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      |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 071b5ad..153fdc9 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -178,6 +178,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 struct list_head store_drivers;
diff --git a/sheep/store.c b/sheep/store.c
index 101cb2b..ccdb925 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -1582,6 +1582,12 @@ static void do_recover_main(struct work *work)
 
 		recovering_work = rw;
 		queue_work(sys->recovery_wqueue, &rw->work);
+	} else {
+		if (sd_store->end_recover) {
+			struct siocb iocb = { 0 };
+			iocb.epoch = sys->epoch;
+			sd_store->end_recover(&iocb);
+		}
 	}
 
 	resume_pending_requests();
-- 
1.7.8.2




More information about the sheepdog mailing list