[PATCH] loopy loop loop

From: Hugh Dickins (hugh@veritas.com)
Date: Tue Feb 04 2003 - 15:11:36 EST


The loop driver's loop over elements of bi_io_vec is in lo_send and
lo_receive: iterating that same transfer bi_vcnt times at the level
above is, er, excessive. (And no need to increment bi_idx here.)

Hugh

--- 2.5.59/drivers/block/loop.c Tue Dec 10 05:49:02 2002
+++ linux/drivers/block/loop.c Tue Feb 4 19:44:01 2003
@@ -350,15 +350,10 @@
         int ret;
 
         pos = ((loff_t) bio->bi_sector << 9) + lo->lo_offset;
-
- do {
- if (bio_rw(bio) == WRITE)
- ret = lo_send(lo, bio, lo->lo_blocksize, pos);
- else
- ret = lo_receive(lo, bio, lo->lo_blocksize, pos);
-
- } while (++bio->bi_idx < bio->bi_vcnt);
-
+ if (bio_rw(bio) == WRITE)
+ ret = lo_send(lo, bio, lo->lo_blocksize, pos);
+ else
+ ret = lo_receive(lo, bio, lo->lo_blocksize, pos);
         return ret;
 }
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 07 2003 - 22:00:15 EST