[sheepdog] [PATCH] object cache: fix reclaim_done()

Liu Yuan namei.unix at gmail.com
Tue Jan 22 08:44:29 CET 2013


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

free() struct reclaim_work instead of struct work.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/object_cache.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index f246ee3..fab6ad4 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -461,8 +461,7 @@ struct reclaim_work {
 
 static void do_reclaim(struct work *work)
 {
-	struct reclaim_work *rw = container_of(work, struct reclaim_work,
-					       work);
+	struct reclaim_work *rw = container_of(work, struct reclaim_work, work);
 	struct object_cache *cache;
 	struct hlist_node *node;
 	int i, j;
@@ -494,8 +493,9 @@ static void do_reclaim(struct work *work)
 
 static void reclaim_done(struct work *work)
 {
+	struct reclaim_work *rw = container_of(work, struct reclaim_work, work);
 	uatomic_set_false(&gcache.in_reclaim);
-	free(work);
+	free(rw);
 }
 
 static int create_dir_for(uint32_t vid)
-- 
1.7.9.5




More information about the sheepdog mailing list