Re: [PATCH scsi-misc-2.6 01/08] scsi: remove unused bounce-buffer release path

James Bottomley
2005-03-23T04:07:53Z

On Wed, 2005-03-23 at 11:14 +0900, Tejun Heo wrote:
> 01_scsi_remove_scsi_release_buffers.patch
>
> Buffer bouncing hasn't been done inside the scsi midlayer for
> quite sometime now, but bounce-buffer release paths are still
> around. This patch removes these unused paths.

Yes, but scsi_release_buffers isn't referring to bounce buffers anymore,
it's simply releasing the sg buffers.

[...]
> - else if (cmd->buffer != req->buffer) {
> - if (rq_data_dir(req) == READ) {
> - unsigned long flags;
> - char *to = bio_kmap_irq(req->bio, &flags);
> - memcpy(to, cmd->buffer, cmd->bufflen);
> - bio_kunmap_irq(to, &flags);
> - }
> - kfree(cmd->buffer);
> - }

I'll defer to Jens here, but I don't thing you can just remove this ...
sg_io with a misaligned buffer will fail without this.

That rather nasty code freeing cmd->buffer needs to be in there as
well ... so it does make sense to keep this API

James