aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2010-10-19 08:21:34 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-26 11:42:31 -0400
commitc4df46c49d8677158c7fb070a08e0d386c80205f (patch)
tree186445dd72adb59b8a4f3b7ab8051d7e1f787f97 /drivers
parentec6a0a41b57feb54b3830918a8fb07147c2ee778 (diff)
[SCSI] libosd: Free resources in reverse order of allocation
At osd_end_request first free the request that might point to pages, then free these pages. In reverse order of allocation. For now it's just anal neatness. When we'll use mempools It'll also pay in performance. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/osd/osd_initiator.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 771ab121acc7..acbdcb670ac5 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -452,10 +452,6 @@ void osd_end_request(struct osd_request *or)
452{ 452{
453 struct request *rq = or->request; 453 struct request *rq = or->request;
454 454
455 _osd_free_seg(or, &or->set_attr);
456 _osd_free_seg(or, &or->enc_get_attr);
457 _osd_free_seg(or, &or->get_attr);
458
459 if (rq) { 455 if (rq) {
460 if (rq->next_rq) { 456 if (rq->next_rq) {
461 _put_request(rq->next_rq); 457 _put_request(rq->next_rq);
@@ -464,6 +460,11 @@ void osd_end_request(struct osd_request *or)
464 460
465 _put_request(rq); 461 _put_request(rq);
466 } 462 }
463
464 _osd_free_seg(or, &or->get_attr);
465 _osd_free_seg(or, &or->enc_get_attr);
466 _osd_free_seg(or, &or->set_attr);
467
467 _osd_request_free(or); 468 _osd_request_free(or);
468} 469}
469EXPORT_SYMBOL(osd_end_request); 470EXPORT_SYMBOL(osd_end_request);