aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-05-07 09:24:39 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 03:50:54 -0400
commit83096ebf1263b2c1ee5e653ba37d993d02e3eb7b (patch)
tree2226b71a616ec1cb2d37511c6a09ba9507a1cd69 /drivers/message
parent5b93629b4509c03ffa87a9316412fedf6f58cb37 (diff)
block: convert to pos and nr_sectors accessors
With recent cleanups, there is no place where low level driver directly manipulates request fields. This means that the 'hard' request fields always equal the !hard fields. Convert all rq->sectors, nr_sectors and current_nr_sectors references to accessors. While at it, drop superflous blk_rq_pos() < 0 test in swim.c. [ Impact: use pos and nr_sectors accessors ] Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Tested-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Acked-by: Mike Miller <mike.miller@hp.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Eric Moore <Eric.Moore@lsi.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Tim Waugh <tim@cyberelk.net> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Dario Ballabio <ballabio_dario@emc.com> Cc: David S. Miller <davem@davemloft.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: unsik Kim <donari75@gmail.com> Cc: Laurent Vivier <Laurent@lvivier.info> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/i2o/i2o_block.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 56e60f0d531..510eb472637 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -761,7 +761,7 @@ static int i2o_block_transfer(struct request *req)
761 break; 761 break;
762 762
763 case CACHE_SMARTFETCH: 763 case CACHE_SMARTFETCH:
764 if (req->nr_sectors > 16) 764 if (blk_rq_sectors(req) > 16)
765 ctl_flags = 0x201F0008; 765 ctl_flags = 0x201F0008;
766 else 766 else
767 ctl_flags = 0x001F0000; 767 ctl_flags = 0x001F0000;
@@ -781,13 +781,13 @@ static int i2o_block_transfer(struct request *req)
781 ctl_flags = 0x001F0010; 781 ctl_flags = 0x001F0010;
782 break; 782 break;
783 case CACHE_SMARTBACK: 783 case CACHE_SMARTBACK:
784 if (req->nr_sectors > 16) 784 if (blk_rq_sectors(req) > 16)
785 ctl_flags = 0x001F0004; 785 ctl_flags = 0x001F0004;
786 else 786 else
787 ctl_flags = 0x001F0010; 787 ctl_flags = 0x001F0010;
788 break; 788 break;
789 case CACHE_SMARTTHROUGH: 789 case CACHE_SMARTTHROUGH:
790 if (req->nr_sectors > 16) 790 if (blk_rq_sectors(req) > 16)
791 ctl_flags = 0x001F0004; 791 ctl_flags = 0x001F0004;
792 else 792 else
793 ctl_flags = 0x001F0010; 793 ctl_flags = 0x001F0010;
@@ -827,22 +827,24 @@ static int i2o_block_transfer(struct request *req)
827 827
828 *mptr++ = cpu_to_le32(scsi_flags); 828 *mptr++ = cpu_to_le32(scsi_flags);
829 829
830 *((u32 *) & cmd[2]) = cpu_to_be32(req->sector * hwsec); 830 *((u32 *) & cmd[2]) = cpu_to_be32(blk_rq_pos(req) * hwsec);
831 *((u16 *) & cmd[7]) = cpu_to_be16(req->nr_sectors * hwsec); 831 *((u16 *) & cmd[7]) = cpu_to_be16(blk_rq_sectors(req) * hwsec);
832 832
833 memcpy(mptr, cmd, 10); 833 memcpy(mptr, cmd, 10);
834 mptr += 4; 834 mptr += 4;
835 *mptr++ = cpu_to_le32(req->nr_sectors << KERNEL_SECTOR_SHIFT); 835 *mptr++ =
836 cpu_to_le32(blk_rq_sectors(req) << KERNEL_SECTOR_SHIFT);
836 } else 837 } else
837#endif 838#endif
838 { 839 {
839 msg->u.head[1] = cpu_to_le32(cmd | HOST_TID << 12 | tid); 840 msg->u.head[1] = cpu_to_le32(cmd | HOST_TID << 12 | tid);
840 *mptr++ = cpu_to_le32(ctl_flags); 841 *mptr++ = cpu_to_le32(ctl_flags);
841 *mptr++ = cpu_to_le32(req->nr_sectors << KERNEL_SECTOR_SHIFT);
842 *mptr++ = 842 *mptr++ =
843 cpu_to_le32((u32) (req->sector << KERNEL_SECTOR_SHIFT)); 843 cpu_to_le32(blk_rq_sectors(req) << KERNEL_SECTOR_SHIFT);
844 *mptr++ =
845 cpu_to_le32((u32) (blk_rq_pos(req) << KERNEL_SECTOR_SHIFT));
844 *mptr++ = 846 *mptr++ =
845 cpu_to_le32(req->sector >> (32 - KERNEL_SECTOR_SHIFT)); 847 cpu_to_le32(blk_rq_pos(req) >> (32 - KERNEL_SECTOR_SHIFT));
846 } 848 }
847 849
848 if (!i2o_block_sglist_alloc(c, ireq, &mptr)) { 850 if (!i2o_block_sglist_alloc(c, ireq, &mptr)) {