Re: [PATCH 08/10] block: cleanup rq->data_len usages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 30 2009, James Bottomley wrote:
> On Thu, 2009-04-30 at 16:47 +0300, Boaz Harrosh wrote:
> > > @@ -966,7 +965,7 @@ static int scsi_init_sgtable(struct request
> > *req, struct scsi_data_buffer *sdb,
> > >       BUG_ON(count > sdb->table.nents);
> > >       sdb->table.nents = count;
> > >       if (blk_pc_request(req))
> > > -             sdb->length = req->data_len;
> > > +             sdb->length = blk_rq_bytes(req);
> > >       else
> > >               sdb->length = blk_rq_sectors(req) << 9;
> > 
> > Is this true. I thought they must be the same now. I was actually
> > anticipating this if() removed.
> 
> Me too ... there's one of these in scsi_lib.c as well.
> 
> The difference comes because filesystem requests are always in sectors,
> but BLOCK_PC requests are always in bytes .... we should be able to wrap
> the accessors so they do the correct conversions.

blk_rq_bytes() already takes care of this, it can be used on any type
request. So just kill the if/else.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux