[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 452 { 453 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 455 if (rq) { 460 456 if (rq->next_rq) { 461 457 _put_request(rq->next_rq); ··· 460 464 461 465 _put_request(rq); 462 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 + 463 472 _osd_request_free(or); 464 473 } 465 474 EXPORT_SYMBOL(osd_end_request);