From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Tejun Heo <htejun@gmail.com>
Cc: axboe@suse.de, jgarzik@pobox.com, James.Bottomley@steeleye.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-2.6-block:post-2.6.15 08/10] blk: update IDE to use new blk_ordered
Date: Thu, 17 Nov 2005 21:11:53 +0100 [thread overview]
Message-ID: <58cb370e0511171211p60e7c248mda477015cf1bd7c5@mail.gmail.com> (raw)
In-Reply-To: <20051117153509.061D8991@htj.dyndns.org>
Hi,
On 11/17/05, Tejun Heo <htejun@gmail.com> wrote:
> 08_blk_ide-update-ordered.patch
>
> Update IDE to use new blk_ordered.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
>
> ide-disk.c | 57 +++++++++------------------------------------------------
> ide-io.c | 5 +----
> 2 files changed, 10 insertions(+), 52 deletions(-)
>
> Index: work/drivers/ide/ide-disk.c
> ===================================================================
> --- work.orig/drivers/ide/ide-disk.c 2005-11-18 00:14:21.000000000 +0900
> +++ work/drivers/ide/ide-disk.c 2005-11-18 00:35:06.000000000 +0900
> @@ -681,50 +681,9 @@ static ide_proc_entry_t idedisk_proc[] =
>
> #endif /* CONFIG_PROC_FS */
>
> -static void idedisk_end_flush(request_queue_t *q, struct request *flush_rq)
> +static void idedisk_prepare_flush(request_queue_t *q, struct request *rq)
> {
> ide_drive_t *drive = q->queuedata;
> - struct request *rq = flush_rq->end_io_data;
> - int good_sectors = rq->hard_nr_sectors;
> - int bad_sectors;
> - sector_t sector;
> -
> - if (flush_rq->errors & ABRT_ERR) {
> - printk(KERN_ERR "%s: barrier support doesn't work\n", drive->name);
> - blk_queue_ordered(drive->queue, QUEUE_ORDERED_NONE);
> - blk_queue_issue_flush_fn(drive->queue, NULL);
> - good_sectors = 0;
> - } else if (flush_rq->errors) {
> - good_sectors = 0;
> - if (blk_barrier_preflush(rq)) {
> - sector = ide_get_error_location(drive,flush_rq->buffer);
> - if ((sector >= rq->hard_sector) &&
> - (sector < rq->hard_sector + rq->hard_nr_sectors))
> - good_sectors = sector - rq->hard_sector;
> - }
> - }
> -
> - if (flush_rq->errors)
> - printk(KERN_ERR "%s: failed barrier write: "
> - "sector=%Lx(good=%d/bad=%d)\n",
> - drive->name, (unsigned long long)rq->sector,
> - good_sectors,
> - (int) (rq->hard_nr_sectors-good_sectors));
> -
> - bad_sectors = rq->hard_nr_sectors - good_sectors;
> -
> - if (good_sectors)
> - __ide_end_request(drive, rq, 1, good_sectors);
> - if (bad_sectors)
> - __ide_end_request(drive, rq, 0, bad_sectors);
> -}
I fail to see how the partial completions (good + bad sectors)
are done in your new scheme, please explain.
> -
> -static int idedisk_prepare_flush(request_queue_t *q, struct request *rq)
> -{
> - ide_drive_t *drive = q->queuedata;
> -
> - if (!drive->wcache)
> - return 0;
What does happen if somebody disables drive->wcache later?
> memset(rq->cmd, 0, sizeof(rq->cmd));
>
> @@ -735,9 +694,8 @@ static int idedisk_prepare_flush(request
> rq->cmd[0] = WIN_FLUSH_CACHE;
>
>
> - rq->flags |= REQ_DRIVE_TASK | REQ_SOFTBARRIER;
> + rq->flags |= REQ_DRIVE_TASK;
> rq->buffer = rq->cmd;
> - return 1;
> }
>
> static int idedisk_issue_flush(request_queue_t *q, struct gendisk *disk,
> @@ -1012,11 +970,12 @@ static void idedisk_setup (ide_drive_t *
> printk(KERN_INFO "%s: cache flushes %ssupported\n",
> drive->name, barrier ? "" : "not ");
> if (barrier) {
> - blk_queue_ordered(drive->queue, QUEUE_ORDERED_FLUSH);
> - drive->queue->prepare_flush_fn = idedisk_prepare_flush;
> - drive->queue->end_flush_fn = idedisk_end_flush;
> + blk_queue_ordered(drive->queue, QUEUE_ORDERED_DRAIN_FLUSH,
> + idedisk_prepare_flush, GFP_KERNEL);
> blk_queue_issue_flush_fn(drive->queue, idedisk_issue_flush);
> - }
> + } else if (!drive->wcache)
> + blk_queue_ordered(drive->queue, QUEUE_ORDERED_DRAIN,
> + NULL, GFP_KERNEL);
What does happen if somebody enables drive->wcache later?
> }
>
> static void ide_cacheflush_p(ide_drive_t *drive)
> @@ -1034,6 +993,8 @@ static int ide_disk_remove(struct device
> struct ide_disk_obj *idkp = drive->driver_data;
> struct gendisk *g = idkp->disk;
>
> + blk_queue_ordered(drive->queue, QUEUE_ORDERED_NONE, NULL, 0);
> +
Shouldn't this be done in ide_disk_release()?
> ide_cacheflush_p(drive);
>
> ide_unregister_subdriver(drive, idkp->driver);
> Index: work/drivers/ide/ide-io.c
> ===================================================================
> --- work.orig/drivers/ide/ide-io.c 2005-11-18 00:35:04.000000000 +0900
> +++ work/drivers/ide/ide-io.c 2005-11-18 00:35:06.000000000 +0900
> @@ -119,10 +119,7 @@ int ide_end_request (ide_drive_t *drive,
> if (!nr_sectors)
> nr_sectors = rq->hard_cur_sectors;
>
> - if (blk_complete_barrier_rq_locked(drive->queue, rq, nr_sectors))
> - ret = rq->nr_sectors != 0;
> - else
> - ret = __ide_end_request(drive, rq, uptodate, nr_sectors);
> + ret = __ide_end_request(drive, rq, uptodate, nr_sectors);
>
> spin_unlock_irqrestore(&ide_lock, flags);
> return ret;
>
next prev parent reply other threads:[~2005-11-17 20:11 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 15:36 [PATCH linux-2.6-block:post-2.6.15 00/10] blk: reimplementation of I/O barrier Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 01/10] blk: add @uptodate to end_that_request_last() and @error to rq_end_io_fn() Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 02/10] blk: separate out bio init part from __make_request Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 03/10] blk: reimplement handling of barrier request Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 04/10] blk: update SCSI to use new blk_ordered Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 05/10] blk: add FUA support to SCSI disk Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 06/10] blk: update libata to use new blk_ordered Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 07/10] blk: add FUA support to libata Tejun Heo
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 08/10] blk: update IDE to use new blk_ordered Tejun Heo
2005-11-17 20:11 ` Bartlomiej Zolnierkiewicz [this message]
2005-11-18 15:07 ` Tejun Heo
2005-11-18 15:59 ` Bartlomiej Zolnierkiewicz
2005-11-22 2:44 ` Tejun Heo
2005-11-22 8:36 ` Bartlomiej Zolnierkiewicz
2005-11-22 8:39 ` Bartlomiej Zolnierkiewicz
2005-11-23 7:23 ` Tejun Heo
2005-11-23 8:40 ` Bartlomiej Zolnierkiewicz
2005-11-23 8:46 ` Jens Axboe
2005-11-23 9:00 ` Tejun
2005-11-23 9:05 ` Bartlomiej Zolnierkiewicz
2005-11-17 15:36 ` [PATCH linux-2.6-block:post-2.6.15 09/10] blk: add FUA support to IDE Tejun Heo
2005-11-17 20:39 ` Bartlomiej Zolnierkiewicz
2005-11-18 15:25 ` Tejun Heo
2005-11-18 16:17 ` Bartlomiej Zolnierkiewicz
2005-11-18 17:02 ` Alan Cox
2005-11-18 16:38 ` Bartlomiej Zolnierkiewicz
2005-11-18 17:41 ` Alan Cox
2005-11-24 11:58 ` Tejun Heo
2005-11-24 12:21 ` Tejun Heo
2005-11-24 14:21 ` Bartlomiej Zolnierkiewicz
2005-11-17 15:37 ` [PATCH linux-2.6-block:post-2.6.15 10/10] blk: I/O barrier documentation Tejun Heo
2005-11-17 16:20 ` [PATCH linux-2.6-block:post-2.6.15 00/10] blk: reimplementation of I/O barrier 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=58cb370e0511171211p60e7c248mda477015cf1bd7c5@mail.gmail.com \
--to=bzolnier@gmail.com \
--cc=James.Bottomley@steeleye.com \
--cc=axboe@suse.de \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--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®