From: Jens Axboe <jens.axboe@oracle.com>
To: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
dm-devel@redhat.com, j-nomura@ce.jp.nec.com
Subject: Re: [RFC PATCH 3/3] blk_end_request: caller change
Date: Thu, 11 Jan 2007 09:34:31 +0100 [thread overview]
Message-ID: <20070111083430.GD11203@kernel.dk> (raw)
In-Reply-To: <20070110.180859.78702215.k-ueda@ct.jp.nec.com>
On Wed, Jan 10 2007, Kiyoshi Ueda wrote:
> +static int end_request_callback(void *arg)
> +{
> + struct request *req = (struct request *)arg;
> +
> + add_disk_randomness(req->rq_disk);
> + blkdev_dequeue_request(req);
> +
> + return 0;
> +}
This is bad, don't pass void * around.
> +static int cdrom_newpc_intr_dma_callback(void *arg)
> +{
> + void **argv = (void **)arg;
> + struct request *rq = (struct request *)*argv++;
> + ide_drive_t *drive = (ide_drive_t *)argv++;
> + spinlock_t *ide_lock = (spinlock_t *)argv;
> +
> + rq->data_len = 0;
> +
> + cdrom_newpc_intr_callback_common(rq, drive, ide_lock);
> +
> + return 0;
> +}
And this is why, down right horrible. The callback should be correctly
typed, pass down a request pointer ALWAYS.
--
Jens Axboe
next prev parent reply other threads:[~2007-01-11 8:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-10 23:08 [RFC PATCH 3/3] blk_end_request: caller change Kiyoshi Ueda
2007-01-11 8:34 ` Jens Axboe [this message]
2007-01-11 17:01 ` Kiyoshi Ueda
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=20070111083430.GD11203@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=dm-devel@redhat.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=k-ueda@ct.jp.nec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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