mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Dave Olien <dmo@osdl.org>
Cc: Jens Axboe <axboe@suse.de>, Samium Gromoff <_deepfire@mail.ru>,
	linux-kernel@vger.kernel.org
Subject: Re: [2.5] DAC960
Date: Fri, 20 Sep 2002 23:32:53 +0200	[thread overview]
Message-ID: <E17sVOQ-0001H8-00@starship> (raw)
In-Reply-To: <20020919150958.A27837@acpi.pdx.osdl.net>

Hi Dave,

Here's the trivial patch you need, on top of your last-posted patch, to fix 
up the one failed hunk and make it work in 2.5.37.

I cleaned up a few stylistic things to bring them in line with 
penguin-classic style, things like never writing "== true" in logical 
expressions and having line breaks in the right places.  Very minor.

Obviously, a lot more trivial cleanup is still needed, especially spelling.  
The code is pretty easy to read, though, including your code.

Daniel

--- 2.5.37.clean/drivers/block/DAC960.c	2002-09-20 23:08:09.000000000 +0200
+++ 2.5.37/drivers/block/DAC960.c	2002-09-20 23:19:47.000000000 +0200
@@ -3007,16 +3007,48 @@
   individual Buffer.
 */
 
-static inline void DAC960_ProcessCompletedBuffer(BufferHeader_T *BufferHeader,
-						 boolean SuccessfulIO)
+static inline void DAC960_ProcessCompletedRequest(DAC960_Command_T *Command,
+	boolean SuccessfulIO)
 {
-  bio_endio(BufferHeader, BufferHeader->bi_size, SuccessfulIO ? 0 : -EIO);
-  blk_finished_io(bio_sectors(BufferHeader));
+	DAC960_CommandType_T CommandType = Command->CommandType;
+	IO_Request_T *Request = Command->Request;
+	int DmaDirection, UpToDate;
+
+	UpToDate = 0;
+	if (SuccessfulIO)
+		UpToDate = 1;
+
+	/*
+	 * We could save DmaDirection in the command structure
+	 * and just reuse that information here.
+	 */
+	if (CommandType == DAC960_ReadCommand || CommandType == DAC960_ReadRetryCommand)
+		DmaDirection = PCI_DMA_FROMDEVICE;
+	else
+		DmaDirection = PCI_DMA_TODEVICE;
+
+	pci_unmap_sg(Command->PciDevice, Command->V1.ScatterList,
+		Command->SegmentCount, DmaDirection);
+
+	/*
+	 * BlockCount is redundant with nr_sectors in the request
+	 * structure.  Consider eliminating BlockCount from the
+	 * command structure now that Command includes a pointer to
+	 * the request.
+	 */
+	while (end_that_request_first(Request, UpToDate, Command->BlockCount))
+		;
+	end_that_request_last(Request);
+
+	if (Command->Completion) {
+		complete(Command->Completion);
+		Command->Completion = NULL;
+	}
 }
 
 static inline int DAC960_PartitionByCommand(DAC960_Command_T *Command)
 {
-	return DAC960_PartitionNumber(to_kdev_t(Command->BufferHeader->bi_bdev->bd_dev)); 
+	return DAC960_PartitionNumber(Command->Request->rq_dev);
 }
 
 /*

  parent reply	other threads:[~2002-09-20 21:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-10  5:30 Samium Gromoff
2002-09-10  6:20 ` Jens Axboe
2002-09-10 16:16   ` Dave Olien
2002-09-15  4:21   ` Daniel Phillips
2002-09-15 13:19     ` Jens Axboe
2002-09-15 15:23       ` Daniel Phillips
2002-09-15 16:18         ` Daniel Phillips
2002-09-16 20:13       ` Dave Olien
2002-09-16 20:26         ` Daniel Phillips
2002-09-16 22:08           ` Dave Olien
2002-09-16 22:25             ` Dave Olien
2002-09-19 18:49           ` Dave Olien
2002-09-19 19:16             ` Daniel Phillips
2002-09-19 22:09               ` Dave Olien
2002-09-19 22:21                 ` Daniel Phillips
2002-09-20  6:21                   ` Jens Axboe
2002-09-20 21:32                 ` Daniel Phillips [this message]
2002-09-19 21:25           ` Dave Olien
2002-09-20  6:20             ` Jens Axboe
2002-09-15 15:14     ` Alan Cox
2002-09-15 16:20       ` Daniel Phillips
2002-09-18 16:17 James Bottomley
2002-09-18 16:40 ` Daniel Phillips
2002-09-23 19:23 Dave Olien

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=E17sVOQ-0001H8-00@starship \
    --to=phillips@arcor.de \
    --cc=_deepfire@mail.ru \
    --cc=axboe@suse.de \
    --cc=dmo@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®