[sheepdog] [PATCH 5/6] Revert "sheep: don't recycle VDI ID"

Liu Yuan namei.unix at gmail.com
Mon Mar 16 13:49:33 CET 2015


From: Liu Yuan <liuyuan at cmss.chinamobile.com>

This reverts commit 21549a1bd4981fabcc09d062a647162127fe0637.

Signed-off-by: Liu Yuan <liuyuan at cmss.chinamobile.com>
---
 sheep/vdi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index dd01a20..af96548 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -1236,6 +1236,13 @@ static int fill_vdi_info_range(uint32_t left, uint32_t right,
 		if (ret != SD_RES_SUCCESS)
 			goto out;
 
+		if (vdi_is_deleted(inode)) {
+			/* Recycle the deleted inode for fresh vdi create */
+			if (!iocb->create_snapshot)
+				info->free_bit = i;
+			continue;
+		}
+
 		if (!strncmp(inode->name, name, sizeof(inode->name))) {
 			sd_debug("%s = %s, %u = %u", iocb->tag, inode->tag,
 				 iocb->snapid, inode->snap_id);
-- 
1.9.1




More information about the sheepdog mailing list