Advance pointer correctly when doing block transfers.
authorDavid Given <dg@cowlark.com>
Thu, 15 Oct 2015 21:03:20 +0000 (23:03 +0200)
committerDavid Given <dg@cowlark.com>
Thu, 15 Oct 2015 21:03:20 +0000 (23:03 +0200)
Kernel/dev/blkdev.c

index e0e1c01..8143509 100644 (file)
@@ -125,11 +125,9 @@ static int blkdev_transfer(uint8_t minor, uint8_t rawflag)
         if(n == 0)
             goto xferfail;
         blk_op.nblock -= n;
-               blk_op.lba += n<<BLKSHIFT;
-               blk_op.addr += n<<BLKSHIFT;
         count += n;
-       blk_op.addr += n * BLKSIZE;
-       blk_op.lba += n;
+               blk_op.addr += n<<BLKSHIFT;
+               blk_op.lba += n;
     }
 
     return count; /* 10/10, would transfer sectors again */