linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Lee <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Doug Maxey <dwm@maxeymade.com>
Subject: [PATCH/RFC 1/3] irq-pio: reorganize ata_pio_sector() and __atapi_pio_bytes()
Date: Thu, 06 Oct 2005 18:40:06 +0800	[thread overview]
Message-ID: <4344FF06.2010708@tw.ibm.com> (raw)
In-Reply-To: <4344FDED.1080402@tw.ibm.com>

Patch 1/3:
   reorganize ata_pio_sector() and __atapi_pio_bytes()

Changes:
   - move some code out of the kmap_atomic() / kunmap_atomic() zone
   - remove the redundant "do_write = (qc->tf.flags & ATA_TFLAG_WRITE);"


For your review, thanks.

Albert
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

===========

--- irq-pio/drivers/scsi/libata-core.c	2005-10-06 16:47:05.000000000 +0800
+++ himem1/drivers/scsi/libata-core.c	2005-10-06 15:59:35.000000000 +0800
@@ -2763,22 +2763,21 @@ static void ata_pio_sector(struct ata_qu
  	local_irq_save(flags);
  	buf = kmap_atomic(page, KM_IRQ0) + offset;

-	qc->cursect++;
-	qc->cursg_ofs++;
-
-	if ((qc->cursg_ofs * ATA_SECT_SIZE) == (&sg[qc->cursg])->length) {
-		qc->cursg++;
-		qc->cursg_ofs = 0;
-	}
-
  	DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");

  	/* do the actual data transfer */
-	do_write = (qc->tf.flags & ATA_TFLAG_WRITE);
  	ata_data_xfer(ap, buf, ATA_SECT_SIZE, do_write);

  	kunmap_atomic(buf - offset, KM_IRQ0);
  	local_irq_restore(flags);
+
+	qc->cursect++;
+	qc->cursg_ofs++;
+
+	if ((qc->cursg_ofs * ATA_SECT_SIZE) == (&sg[qc->cursg])->length) {
+		qc->cursg++;
+		qc->cursg_ofs = 0;
+	}
  }

  /**
@@ -2956,6 +2955,14 @@ next_sg:
  	local_irq_save(flags);
  	buf = kmap_atomic(page, KM_IRQ0) + offset;

+	DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");
+
+	/* do the actual data transfer */
+	ata_data_xfer(ap, buf, count, do_write);
+
+	kunmap_atomic(buf - offset, KM_IRQ0);
+	local_irq_restore(flags);
+
  	bytes -= count;
  	qc->curbytes += count;
  	qc->cursg_ofs += count;
@@ -2965,14 +2972,6 @@ next_sg:
  		qc->cursg_ofs = 0;
  	}

-	DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");
-
-	/* do the actual data transfer */
-	ata_data_xfer(ap, buf, count, do_write);
-
-	kunmap_atomic(buf - offset, KM_IRQ0);
-	local_irq_restore(flags);
-
  	if (bytes)
  		goto next_sg;
  }



  reply	other threads:[~2005-10-06 10:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-05  7:35 highmem pages Jeff Garzik
2005-10-06 10:35 ` Albert Lee
2005-10-06 10:40   ` Albert Lee [this message]
2005-10-06 10:42   ` [PATCH/RFC 2/3] irq-pio: reorganize "buf + offset" Albert Lee
2005-10-06 10:44   ` [PATCH/RFC 3/3] " Albert Lee
2005-10-06 11:20   ` highmem pages Jeff Garzik
2005-10-07  6:00     ` Albert Lee
2005-10-07  6:08     ` [PATCH 0/3] libata-dev: use PageHighMem() to optimize kmap_atomic() usage Albert Lee
2005-10-07  6:12     ` [PATCH 1/3] irq-pio: reorganize ata_pio_sector() and __atapi_pio_bytes() Albert Lee
2005-10-07  6:18     ` [PATCH 2/3] irq-pio: reorganize "buf + offset" Albert Lee
2005-10-07  6:20     ` [PATCH 3/3] irq-pio: use PageHighMem() to optimize the kmap_atomic() usage Albert Lee
2005-10-09 13:49       ` Jeff Garzik

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=4344FF06.2010708@tw.ibm.com \
    --to=albertcc@tw.ibm.com \
    --cc=bzolnier@gmail.com \
    --cc=dwm@maxeymade.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).