remaining = current_count_sectors << 9;
#ifdef FLOPPY_SANITY_CHECK
- if ((remaining >> 9) > blk_rq_sectors(current_req) &&
- CT(COMMAND) == FD_WRITE) {
+ if (remaining > blk_rq_bytes(current_req) && CT(COMMAND) == FD_WRITE) {
DPRINT("in copy buffer\n");
printk("current_count_sectors=%ld\n", current_count_sectors);
printk("remaining=%d\n", remaining >> 9);
dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9);
- size = blk_rq_cur_sectors(current_req) << 9;
+ size = blk_rq_cur_bytes(current_req);
rq_for_each_segment(bv, current_req, iter) {
if (!remaining)
printk("write\n");
return 0;
}
- } else if (raw_cmd->length > blk_rq_sectors(current_req) << 9 ||
+ } else if (raw_cmd->length > blk_rq_bytes(current_req) ||
current_count_sectors > blk_rq_sectors(current_req)) {
DPRINT("buffer overrun in direct transfer\n");
return 0;
req, error ? "failed" : "done");
spin_lock_irqsave(q->queue_lock, flags);
- __blk_end_request(req, error, blk_rq_sectors(req) << 9);
+ __blk_end_request_all(req, error);
spin_unlock_irqrestore(q->queue_lock, flags);
}
{
int result, flags;
struct nbd_request request;
- unsigned long size = blk_rq_sectors(req) << 9;
+ unsigned long size = blk_rq_bytes(req);
request.magic = htonl(NBD_REQUEST_MAGIC);
request.type = htonl(nbd_cmd(req));
lo->disk->disk_name, req,
nbdcmd_to_ascii(nbd_cmd(req)),
(unsigned long long)blk_rq_pos(req) << 9,
- blk_rq_sectors(req) << 9);
+ blk_rq_bytes(req));
result = sock_xmit(lo, 1, &request, sizeof(request),
(nbd_cmd(req) == NBD_CMD_WRITE) ? MSG_MORE : 0);
if (result <= 0) {
cmd->cdb[8] = nblks;
cmd->cdb_len = 10;
- cmd->len = blk_rq_sectors(rq) * 512;
+ cmd->len = blk_rq_bytes(rq);
}
static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,
struct request *req;
while ((req = elv_next_request(q)) != NULL) {
unsigned long start = blk_rq_pos(req) << 9;
- unsigned long len = blk_rq_cur_sectors(req) << 9;
+ unsigned long len = blk_rq_cur_bytes(req);
if (start + len > z2ram_size) {
printk( KERN_ERR DEVICE_NAME ": bad access: block=%lu, count=%u\n",
t_sec = blk_rq_pos(msb->block_req) << 9;
sector_div(t_sec, msb->page_size);
- count = blk_rq_sectors(msb->block_req) << 9;
+ count = blk_rq_bytes(msb->block_req);
count /= msb->page_size;
param.system = msb->system;
t_len *= msb->page_size;
}
} else
- t_len = blk_rq_sectors(msb->block_req) << 9;
+ t_len = blk_rq_bytes(msb->block_req);
dev_dbg(&card->dev, "transferred %x (%d)\n", t_len, error);
struct request_queue *q = req->q;
unsigned long flags;
- if (blk_end_request(req, error, nr_bytes)) {
- int leftover = (blk_rq_sectors(req) << KERNEL_SECTOR_SHIFT);
-
- if (blk_pc_request(req))
- leftover = blk_rq_bytes(req);
-
+ if (blk_end_request(req, error, nr_bytes))
if (error)
- blk_end_request(req, -EIO, leftover);
- }
+ blk_end_request_all(req, -EIO);
spin_lock_irqsave(q->queue_lock, flags);
memcpy(mptr, cmd, 10);
mptr += 4;
- *mptr++ =
- cpu_to_le32(blk_rq_sectors(req) << KERNEL_SECTOR_SHIFT);
+ *mptr++ = cpu_to_le32(blk_rq_bytes(req));
} else
#endif
{
msg->u.head[1] = cpu_to_le32(cmd | HOST_TID << 12 | tid);
*mptr++ = cpu_to_le32(ctl_flags);
- *mptr++ =
- cpu_to_le32(blk_rq_sectors(req) << KERNEL_SECTOR_SHIFT);
+ *mptr++ = cpu_to_le32(blk_rq_bytes(req));
*mptr++ =
cpu_to_le32((u32) (blk_rq_pos(req) << KERNEL_SECTOR_SHIFT));
*mptr++ =
char *buf;
block = blk_rq_pos(req) << 9 >> tr->blkshift;
- nsect = blk_rq_cur_sectors(req) << 9 >> tr->blkshift;
+ nsect = blk_rq_cur_bytes(req) >> tr->blkshift;
buf = req->buffer;
while ((req = elv_next_request(q)) != NULL) {
struct jsfd_part *jdp = req->rq_disk->private_data;
unsigned long offset = blk_rq_pos(req) << 9;
- size_t len = blk_rq_cur_sectors(req) << 9;
+ size_t len = blk_rq_cur_bytes(req);
if ((offset + len) > jdp->dsize) {
__blk_end_request_cur(req, -EIO);
* to queue the remainder of them.
*/
if (blk_end_request(req, error, bytes)) {
- int leftover = blk_rq_sectors(req) << 9;
+ int leftover = blk_rq_bytes(req);
if (blk_pc_request(req))
leftover = req->resid_len;
count = blk_rq_map_sg(req->q, req, sdb->table.sgl);
BUG_ON(count > sdb->table.nents);
sdb->table.nents = count;
- if (blk_pc_request(req))
- sdb->length = blk_rq_bytes(req);
- else
- sdb->length = blk_rq_sectors(req) << 9;
+ sdb->length = blk_rq_bytes(req);
return BLKPREP_OK;
}