[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>

authored by Boaz Harrosh and committed by James Bottomley c4df46c4 ec6a0a41

+5 -4
+5 -4
drivers/scsi/osd/osd_initiator.c
··· 452 { 453 struct request *rq = or->request; 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) { 460 if (rq->next_rq) { 461 _put_request(rq->next_rq); ··· 460 461 _put_request(rq); 462 } 463 _osd_request_free(or); 464 } 465 EXPORT_SYMBOL(osd_end_request);
··· 452 { 453 struct request *rq = or->request; 454 455 if (rq) { 456 if (rq->next_rq) { 457 _put_request(rq->next_rq); ··· 464 465 _put_request(rq); 466 } 467 + 468 + _osd_free_seg(or, &or->get_attr); 469 + _osd_free_seg(or, &or->enc_get_attr); 470 + _osd_free_seg(or, &or->set_attr); 471 + 472 _osd_request_free(or); 473 } 474 EXPORT_SYMBOL(osd_end_request);