All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, jeff@garzik.org,
	linux-ide@vger.kernel.org, James.Bottomley@HansenPartnership.com,
	linux-scsi@vger.kernel.org, bzolnier@gmail.com,
	petkovbb@googlemail.com, sshtylyov@ru.mvista.com,
	mike.miller@hp.com, chirag.kantharia@hp.com, Eric.Moore@lsi.com,
	stern@rowland.harvard.edu, fujita.tomonori@lab.ntt.co.jp,
	zaitcev@redhat.com, Geert.Uytterhoeven@sonycom.com,
	sfr@canb.auug.org.au, grant.likely@secretlab.ca,
	paul.clements@steeleye.com, jesper.juhl@gmail.com,
	tim@cyberelk.net, jeremy@xensource.com, adrian@mcmen.demon.co.uk,
	oakad@yahoo.com, dwmw2@infradead.org, schwidefsky@de.ibm.com,
	ballabio_dario@emc.com, davem@davemloft.net,
	rusty@rustcorp.com.au, Markus.Lidel@shadowconnect.com,
	"Darrick J. Wong" <djwong@us.ibm.com>
Subject: Re: [PATCH 08/10] block: cleanup rq->data_len usages
Date: Sun, 03 May 2009 10:36:57 +0900	[thread overview]
Message-ID: <49FCF539.2060408@kernel.org> (raw)
In-Reply-To: <49F9AC04.9060403@panasas.com>

Hello, Boaz.

Boaz Harrosh wrote:
>>  	/* The req and req->next_rq have not been completed */
>> -	BUG_ON(blk_end_bidi_request(req, 0, dlen, next_dlen));
>> +	BUG_ON(blk_end_bidi_request(req, 0, blk_rq_bytes(req),
>> +				    blk_rq_bytes(req->next_rq)));
>>  
> 
> Just blk_end_request_all() actually. If you let blk_end_request_all
> also do bidi

I wrote in the other reply but I don't want to make any other change
than converting direct accesses to accessors in this patch, so that we
can _know_ this patch is safe.  Patches in this series are already all
over the place.  But, yeah, cleaning this up would be great.  Care to
send a patch?

>>  	scsi_release_buffers(cmd);
>>  
> 
> and then it can be in-lined into caller, where blk_pc_request(req)
> just do blk_end_request_all regardless (and only the residual
> setting is conditional)
> 
> I'll send a patch to scsi_lib later once this settles a bit.

Ah.. cool.  :-)

>> @@ -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.

Replied in the other reply.

>>  	/* FIXME: should be include in osd_sense_info */
>>  	if (in_resid)
>> -		*in_resid = or->in.req ? or->in.req->data_len : 0;
>> +		*in_resid = or->in.req ? blk_rq_bytes(or->in.req) : 0;
> 
> +		*in_resid = or->in.req ? or->in.req->resid_len : 0;
> 
>>  
>>  	if (out_resid)
>> -		*out_resid = or->out.req ? or->out.req->data_len : 0;
>> +		*out_resid = or->out.req ? blk_rq_bytes(or->out.req) : 0;
> 
> +		*out_resid = or->out.req ? or->out.req->resid_len : 0;
> 
>>  
>>  	return ret;
>>  }
> 
> OK This segment is wrong. It should be moved to the residual count patch
> (PATCH 3/10) the assignment into *in_resid/*out_resid should shourly triggered
> a warning ;-)

Ah... thanks a lot for spotting it.  Will fix.

Thanks.

-- 
tejun

  parent reply	other threads:[~2009-05-03  1:36 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29  9:13 [GIT PATCH] block,scsi,ide: unify sector and data_len Tejun Heo
2009-04-29  9:13 ` Tejun Heo
2009-04-29  9:13 ` [PATCH 01/10] nbd: don't clear rq->sector and nr_sectors unnecessarily Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-29  9:13 ` [PATCH 02/10] ide-tape: don't initialize rq->sector for rw requests Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-30  6:14   ` Borislav Petkov
2009-04-29  9:13 ` [PATCH 03/10] block: add rq->resid_len Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-29 14:41   ` James Bottomley
2009-04-30  1:59     ` Tejun Heo
2009-04-30  6:45       ` Borislav Petkov
2009-04-30  7:19         ` Tejun Heo
2009-04-30  7:19           ` Tejun Heo
2009-04-30  7:37           ` Borislav Petkov
2009-04-30  9:25             ` Tejun Heo
2009-04-30  9:25               ` Tejun Heo
2009-04-30  9:25             ` Tejun Heo
2009-04-30  7:19         ` Tejun Heo
2009-04-29  9:13 ` [PATCH 04/10] block: implement blk_rq_pos/[cur_]sectors() and convert obvious ones Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-29  9:25   ` Geert Uytterhoeven
2009-04-29  9:25     ` Geert Uytterhoeven
2009-04-29 10:16     ` Tejun Heo
2009-04-29 14:18   ` Stephen Rothwell
2009-04-29 14:49   ` Grant Likely
2009-04-29 14:49     ` Grant Likely
2009-04-29  9:13 ` [PATCH 05/10] block: convert to pos and nr_sectors accessors Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-29  9:40   ` Geert Uytterhoeven
2009-04-29  9:40     ` Geert Uytterhoeven
2009-04-29 10:19     ` Tejun Heo
2009-04-29 14:48   ` Grant Likely
     [not found]   ` <1241037446.4516.2.camel@localhost.localdomain>
2009-04-30 17:30     ` Adrian McMenamin
2009-04-29  9:13 ` [PATCH 06/10] ide: convert to rq " Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-29  9:13 ` [PATCH 07/10] block: drop request->hard_* and *nr_sectors Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-30 13:46   ` Boaz Harrosh
2009-05-04  5:06     ` Tejun Heo
2009-04-29  9:13 ` [PATCH 08/10] block: cleanup rq->data_len usages Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-30 13:47   ` Boaz Harrosh
2009-04-30 15:35     ` James Bottomley
2009-05-01 18:27       ` Jens Axboe
2009-05-03  1:32       ` Tejun Heo
2009-05-03 13:51         ` Boaz Harrosh
2009-05-04  4:19           ` Tejun Heo
2009-05-03  1:36     ` Tejun Heo [this message]
2009-04-29  9:13 ` [PATCH 09/10] ide: " Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-29  9:13 ` [PATCH 10/10] block: hide request sector and data_len Tejun Heo
2009-04-29  9:13   ` Tejun Heo
2009-04-30 16:07 ` [GIT PATCH] block,scsi,ide: unify " Bartlomiej Zolnierkiewicz
2009-05-01 18:29 ` Jens Axboe
2009-05-03  2:50   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49FCF539.2060408@kernel.org \
    --to=tj@kernel.org \
    --cc=Eric.Moore@lsi.com \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Markus.Lidel@shadowconnect.com \
    --cc=adrian@mcmen.demon.co.uk \
    --cc=axboe@kernel.dk \
    --cc=ballabio_dario@emc.com \
    --cc=bharrosh@panasas.com \
    --cc=bzolnier@gmail.com \
    --cc=chirag.kantharia@hp.com \
    --cc=davem@davemloft.net \
    --cc=djwong@us.ibm.com \
    --cc=dwmw2@infradead.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=grant.likely@secretlab.ca \
    --cc=jeff@garzik.org \
    --cc=jeremy@xensource.com \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --cc=oakad@yahoo.com \
    --cc=paul.clements@steeleye.com \
    --cc=petkovbb@googlemail.com \
    --cc=rusty@rustcorp.com.au \
    --cc=schwidefsky@de.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=sshtylyov@ru.mvista.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tim@cyberelk.net \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.