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

Next file: linux/drivers/block/nbd.c
Previous file: linux/drivers/block/ide_modes.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
@@ -212,15 +212,18 @@
 				struct request *next, int max_segments)
 {
 	int total_segments = req->nr_segments + next->nr_segments;
+       int same_segment;
 
+       same_segment = 0;
 	if (req->bhtail->b_data + req->bhtail->b_size == next->bh->b_data) {
 		total_segments--;
-		q->nr_segments--;
+               same_segment = 1;
 	}
     
 	if (total_segments > max_segments)
 		return 0;
 
+       q->nr_segments -= same_segment;
 	req->nr_segments = total_segments;
 	return 1;
 }
@@ -472,14 +475,8 @@
 	int sequence = elevator_sequence(&q->elevator, latency);
 	if (after)
 		sequence -= req->nr_segments;
-	if (elevator_sequence_before(sequence, req->elevator_sequence)) {
-		if (!after)
-			printk(KERN_WARNING __FUNCTION__
-			       ": req latency %d req latency %d\n",
-			       req->elevator_sequence - q->elevator.sequence,
-			       sequence - q->elevator.sequence);
+	if (elevator_sequence_before(sequence, req->elevator_sequence))
 		req->elevator_sequence = sequence;
-	}
 }
 
 static inline void elevator_queue(request_queue_t * q,

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