From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH 04/11] block: implement blk_rq_pos/[cur_]sectors() and convert obvious ones Date: Mon, 04 May 2009 17:45:24 +0400 Message-ID: <49FEF174.6040505@ru.mvista.com> References: <1241423927-11871-1-git-send-email-tj@kernel.org> <1241423927-11871-5-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from h155.mvista.com ([63.81.120.155]:41910 "EHLO imap.sh.mvista.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750979AbZEDNoH (ORCPT ); Mon, 4 May 2009 09:44:07 -0400 In-Reply-To: <1241423927-11871-5-git-send-email-tj@kernel.org> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Tejun Heo 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, mike.miller@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, 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, bharrosh@panasas.com Tejun Heo wrote: > Implement accessors - blk_rq_pos(), blk_rq_sectors() and > blk_rq_cur_sectors() which return rq->sector, rq->hard_nr_sectors and Well, blk_rq_pos() returns rq->hard_sector, not rq->sector, doesn't it? > rq->hard_cur_sectors respectively and convert direct references of the > said fields to the accessors. > This is in preparation of request data length handling cleanup. > const added to struct request * parameter to accessors as suggested by > Geert Uytterhoeven. > [ Impact: cleanup ] > Signed-off-by: Tejun Heo > Acked-by: Geert Uytterhoeven > Acked-by: Stephen Rothwell > Tested-by: Grant Likely > Acked-by: Grant Likely Acked-by: Sergei Shtylyov > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 7ab93d9..b921d91 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -833,13 +833,30 @@ static inline void blk_run_address_space(struct address_space *mapping) > extern void blkdev_dequeue_request(struct request *req); > > /* > - * blk_end_request() takes bytes instead of sectors as a complete size. > - * blk_rq_bytes() returns bytes left to complete in the entire request. > - * blk_rq_cur_bytes() returns bytes left to complete in the current segment. > + * blk_rq_pos() : the current sector > + * blk_rq_bytes() : bytes left in the entire request > + * blk_rq_cur_bytes() : bytes left in the current segment > + * blk_rq_sectors() : sectors left in the entire request > + * blk_rq_cur_sectors() : sectors left in the current segment > */ > +static inline sector_t blk_rq_pos(const struct request *rq) > +{ > + return rq->hard_sector; > +} > + [...] MBR, Sergei