[Sheepdog] [PATCH v4 1/6] remove useless inode in del_vdi()

levin li levin108 at gmail.com
Thu May 3 12:25:44 CEST 2012


The inode defined and allocated in del_vdi() is no longer used,
we should remove the useless code.

Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/vdi.c |    9 ---------
 1 file changed, 9 deletions(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index d80ae34..8cd71f2 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -342,14 +342,6 @@ int del_vdi(uint32_t epoch, char *data, int data_len, uint32_t *vid,
 	uint32_t dummy0;
 	unsigned long dummy1, dummy2;
 	int ret;
-	struct sheepdog_inode *inode = NULL;
-
-	inode = malloc(SD_INODE_HEADER_SIZE);
-	if (!inode) {
-		eprintf("failed to allocate memory\n");
-		ret = SD_RES_NO_MEM;
-		goto out;
-	}
 
 	if (data_len == SD_MAX_VDI_LEN + SD_MAX_VDI_TAG_LEN)
 		tag = data + SD_MAX_VDI_LEN;
@@ -367,7 +359,6 @@ int del_vdi(uint32_t epoch, char *data, int data_len, uint32_t *vid,
 
 	ret = start_deletion(*vid, epoch);
 out:
-	free(inode);
 	return ret;
 }
 
-- 
1.7.10




More information about the sheepdog mailing list