lkml.org 
[lkml]   [2003]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] loopy loop loop
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/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.062 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site