Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932322AbZD3PhY (ORCPT ); Thu, 30 Apr 2009 11:37:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932181AbZD3PgI (ORCPT ); Thu, 30 Apr 2009 11:36:08 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:44445 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932186AbZD3PgB (ORCPT ); Thu, 30 Apr 2009 11:36:01 -0400 Subject: Re: [PATCH 08/10] block: cleanup rq->data_len usages From: James Bottomley To: Boaz Harrosh Cc: Tejun Heo , axboe@kernel.dk, linux-kernel@vger.kernel.org, jeff@garzik.org, linux-ide@vger.kernel.org, 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" In-Reply-To: <49F9AC04.9060403@panasas.com> References: <1240996428-10159-1-git-send-email-tj@kernel.org> <1240996428-10159-9-git-send-email-tj@kernel.org> <49F9AC04.9060403@panasas.com> Content-Type: text/plain Date: Thu, 30 Apr 2009 10:35:57 -0500 Message-Id: <1241105757.3320.1.camel@mulgrave.int.hansenpartnership.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 28 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. James -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/