mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adam J. Richter" <adam@yggdrasil.com>
To: lnz@dandelion.com, linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: Patch(?): linux-2.5.1-pre7/drivers/block/DAC960.c compilation fixes
Date: Sat, 8 Dec 2001 21:12:32 -0800	[thread overview]
Message-ID: <20011208211232.A7241@adam.yggdrasil.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

	The following patch makes linux-2.5.1-pre7/drivers/block/DAC960.c
compile.  I'm not confident in my understanding of the new "bio" system,
so it would be helpful if someone more knowledgeable about bio could
check it.  The changes are:

	1. Delete references the nonexistant MaxSectorsPerRequest field.
	   The code already sets RequestQueue->max_sectors.

	2. Replace the undefined bio_size(BufferHead) with BufferHead->bi_size
	   (in many places, which is why the diff is big).

	3. Add a missing parameter in one place, changing
		BufferHeader->bi_end_io(BufferHeader)
	   to
		BufferHeader->bi_end_io(BufferHeader, bio_sectors(BufferHeader))


	#3 is the one that I have the most doubts about.

	Anyhow, with this patch and the one that I posted for
drivers/block/xd.c, all of the x86-compatible drivers in
linux-2.5.1-pre7/drivers/block/ seem to compile (as modules, except for
rd.c, which is compiled in).

	Alas, there are about 90 other files outside of drivers/block/
that do not compile.  I will probably try to fix some of those next.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

[-- Attachment #2: DAC960.diff --]
[-- Type: text/plain, Size: 4674 bytes --]

--- linux-2.5.1-pre7/drivers/block/DAC960.c	Fri Dec  7 19:37:41 2001
+++ linux/drivers/block/DAC960.c	Sat Dec  8 20:52:40 2001
@@ -1931,7 +1931,6 @@
 {
   int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber;
   RequestQueue_T *RequestQueue;
-  int MinorNumber;
   /*
     Register the Block Device Major Number for this DAC960 Controller.
   */
@@ -1956,9 +1955,6 @@
     Initialize the Disk Partitions array, Partition Sizes array, Block Sizes
     array, and Max Sectors per Request array.
   */
-  for (MinorNumber = 0; MinorNumber < DAC960_MinorCount; MinorNumber++)
-    Controller->MaxSectorsPerRequest[MinorNumber] =
-      Controller->MaxBlocksPerCommand;
   Controller->GenericDiskInfo.part = Controller->DiskPartitions;
   Controller->GenericDiskInfo.sizes = Controller->PartitionSizes;
   blksize_size[MajorNumber] = Controller->BlockSizes;
@@ -2744,17 +2740,17 @@
 	  if (bio_data(BufferHeader) == LastDataEndPointer)
 	    {
 	      ScatterGatherList[SegmentNumber-1].SegmentByteCount +=
-		bio_size(BufferHeader);
-	      LastDataEndPointer += bio_size(BufferHeader);
+		BufferHeader->bi_size;
+	      LastDataEndPointer += BufferHeader->bi_size;
 	    }
 	  else
 	    {
 	      ScatterGatherList[SegmentNumber].SegmentDataPointer =
 		Virtual_to_Bus32(bio_data(BufferHeader));
 	      ScatterGatherList[SegmentNumber].SegmentByteCount =
-		bio_size(BufferHeader);
+		BufferHeader->bi_size;
 	      LastDataEndPointer = bio_data(BufferHeader) +
-		bio_size(BufferHeader);
+		BufferHeader->bi_size;
 	      if (SegmentNumber++ > Controller->DriverScatterGatherLimit)
 		panic("DAC960: Scatter/Gather Segment Overflow\n");
 	    }
@@ -2835,17 +2831,17 @@
 	  if (bio_data(BufferHeader) == LastDataEndPointer)
 	    {
 	      ScatterGatherList[SegmentNumber-1].SegmentByteCount +=
-		bio_size(BufferHeader);
-	      LastDataEndPointer += bio_size(BufferHeader);
+		BufferHeader->bi_size;
+	      LastDataEndPointer += BufferHeader->bi_size;
 	    }
 	  else
 	    {
 	      ScatterGatherList[SegmentNumber].SegmentDataPointer =
 		Virtual_to_Bus64(bio_data(BufferHeader));
 	      ScatterGatherList[SegmentNumber].SegmentByteCount =
-		bio_size(BufferHeader);
+		BufferHeader->bi_size;
 	      LastDataEndPointer = bio_data(BufferHeader) +
-		bio_size(BufferHeader);
+		BufferHeader->bi_size;
 	      if (SegmentNumber++ > Controller->DriverScatterGatherLimit)
 		panic("DAC960: Scatter/Gather Segment Overflow\n");
 	    }
@@ -2947,7 +2943,7 @@
   if (SuccessfulIO)
     set_bit(BIO_UPTODATE, &BufferHeader->bi_flags);
   blk_finished_io(bio_sectors(BufferHeader));
-  BufferHeader->bi_end_io(BufferHeader);
+  BufferHeader->bi_end_io(BufferHeader, bio_sectors(BufferHeader));
 }
 
 
@@ -3063,7 +3059,7 @@
 	      Command->CommandType = DAC960_WriteRetryCommand;
 	      CommandMailbox->Type5.CommandOpcode = DAC960_V1_Write;
 	    }
-	  Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+	  Command->BlockCount = BufferHeader->bi_size >> DAC960_BlockSizeBits;
 	  CommandMailbox->Type5.LD.TransferLength = Command->BlockCount;
 	  CommandMailbox->Type5.BusAddress =
 	    Virtual_to_Bus32(bio_data(BufferHeader));
@@ -3112,9 +3108,9 @@
 	  DAC960_V1_CommandMailbox_T *CommandMailbox =
 	    &Command->V1.CommandMailbox;
 	  Command->BlockNumber +=
-	    bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+	    BufferHeader->bi_size >> DAC960_BlockSizeBits;
 	  Command->BlockCount =
-	    bio_size(NextBufferHeader) >> DAC960_BlockSizeBits;
+	    NextBufferHeader->bi_size >> DAC960_BlockSizeBits;
 	  Command->BufferHeader = NextBufferHeader;
 	  CommandMailbox->Type5.LD.TransferLength = Command->BlockCount;
 	  CommandMailbox->Type5.LogicalBlockAddress = Command->BlockNumber;
@@ -4160,7 +4156,7 @@
 	  if (CommandType == DAC960_ReadCommand)
 	    Command->CommandType = DAC960_ReadRetryCommand;
 	  else Command->CommandType = DAC960_WriteRetryCommand;
-	  Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+	  Command->BlockCount = BufferHeader->bi_size >> DAC960_BlockSizeBits;
 	  CommandMailbox->SCSI_10.CommandControlBits
 				 .AdditionalScatterGatherListMemory = false;
 	  CommandMailbox->SCSI_10.DataTransferSize =
@@ -4216,9 +4212,9 @@
       if (NextBufferHeader != NULL)
 	{
 	  Command->BlockNumber +=
-	    bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+	    BufferHeader->bi_size >> DAC960_BlockSizeBits;
 	  Command->BlockCount =
-	    bio_size(NextBufferHeader) >> DAC960_BlockSizeBits;
+	    NextBufferHeader->bi_size >> DAC960_BlockSizeBits;
 	  Command->BufferHeader = NextBufferHeader;
 	  CommandMailbox->SCSI_10.DataTransferSize =
 	    Command->BlockCount << DAC960_BlockSizeBits;

             reply	other threads:[~2001-12-09  5:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-09  5:12 Adam J. Richter [this message]
2001-12-09 11:36 ` Jens Axboe

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=20011208211232.A7241@adam.yggdrasil.com \
    --to=adam@yggdrasil.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lnz@dandelion.com \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®