patch-2.4.26 linux-2.4.26/drivers/block/ll_rw_blk.c

Next file: linux-2.4.26/drivers/bluetooth/hci_usb.c
Previous file: linux-2.4.26/drivers/block/cciss_scsi.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.25/drivers/block/ll_rw_blk.c linux-2.4.26/drivers/block/ll_rw_blk.c
@@ -942,6 +942,15 @@
 		return;
 
 	q->elevator.elevator_merge_req_fn(req, next);
+	
+	/* At this point we have either done a back merge
+	 * or front merge. We need the smaller start_time of
+	 * the merged requests to be the current request
+	 * for accounting purposes.
+	 */
+	if (time_after(req->start_time, next->start_time))
+		req->start_time = next->start_time;
+		
 	req->bhtail->b_reqnext = next->bh;
 	req->bhtail = next->bhtail;
 	req->nr_sectors = req->hard_nr_sectors += next->hard_nr_sectors;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)