FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 05-04-2010, 03:37 AM
Mike Anderson
 
Default scsi: Add a scsi_unprep_fn

Add scsi_unprep_fn and set this function as the unprep_rq_fn for the scsi
queue. This will allow SCSI resources to be released if the block layer
unpreps a request.

Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Cc: James Bottomley <James.Bottomley@suse.de>
---
drivers/scsi/scsi_lib.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1646fe7..1685d35 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -91,6 +91,17 @@ static void scsi_unprep_request(struct request *req)
scsi_put_command(cmd);
}

+static void scsi_unprep_fn(struct request_queue *q, struct request *req)
+{
+ struct scsi_cmnd *cmd = req->special;
+
+ if (cmd) {
+ scsi_release_buffers(cmd);
+ scsi_unprep_request(req);
+ }
+}
+
+
/**
* __scsi_queue_insert - private queue insertion
* @cmd: The SCSI command being requeued
@@ -1664,6 +1675,7 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
return NULL;

blk_queue_prep_rq(q, scsi_prep_fn);
+ blk_queue_unprep_rq(q, scsi_unprep_fn);
blk_queue_softirq_done(q, scsi_softirq_done);
blk_queue_rq_timed_out(q, scsi_times_out);
blk_queue_lld_busy(q, scsi_lld_busy);
--
1.6.6.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 05-04-2010, 10:43 AM
Hannes Reinecke
 
Default scsi: Add a scsi_unprep_fn

Mike Anderson wrote:
> Add scsi_unprep_fn and set this function as the unprep_rq_fn for the scsi
> queue. This will allow SCSI resources to be released if the block layer
> unpreps a request.
>
> Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
> Cc: James Bottomley <James.Bottomley@suse.de>
Acked-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 05-04-2010, 10:48 AM
Jens Axboe
 
Default scsi: Add a scsi_unprep_fn

On Mon, May 03 2010, Mike Anderson wrote:
> Add scsi_unprep_fn and set this function as the unprep_rq_fn for the scsi
> queue. This will allow SCSI resources to be released if the block layer
> unpreps a request.

Looks fine, I would fold this in with patches 3+4, there's no point in
separating them this much.


--
Jens Axboe

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 11:18 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org