[Stgt-devel] [PATCH] add stgt_device_template example

FUJITA Tomonori tomof at acm.org
Tue Aug 23 17:47:40 CEST 2005


From: Mike Christie <michaelc at cs.wisc.edu>
Subject: [Stgt-devel] [PATCH] add stgt_device_template example
Date: Tue, 23 Aug 2005 00:59:16 -0500

> This adds the beginings of a stgt_device_template for
> passthrough commands. It will end up using the block
> layer BLOCK_PC facility to pass the command to the
> underlying device similar to how we do it for SG_IO
> and dm-multipath hw_handlers like dm-emc.c.
> 
> It is not completely hooked in yet. The command
> handling needs to be done and so does the actual
> device creation.
> 
> This was built over my last patch.

The patch to fix memory leak.

diff -x CVS -x .svn -x GPATH -x GRTAGS -x GSYMS -x GTAGS -x .config -u --new-file --recursive stgt.vsd/kernel/stgt_sd.c stgt.work/kernel/stgt_sd.c
--- stgt.vsd/kernel/stgt_sd.c	2005-08-23 23:47:50.000000000 +0900
+++ stgt.work/kernel/stgt_sd.c	2005-08-24 00:45:16.000000000 +0900
@@ -71,10 +71,6 @@
 	if (err)
 		return err;
 
-	sddev = kmalloc(sizeof(*sddev), GFP_KERNEL);
-	if (!sddev)
-		return -ENOMEM;
-
 	err = open_dev(sddev, devt);
 	if (err)
 		goto free_sddev;



More information about the stgt mailing list