Re: [PATCH] 2.4.x write barriers (updated for ext3)

Jens Axboe
2002-03-05T07:49:24Z

On Mon, Mar 04 2002, Daniel Phillips wrote:
> But the bio layer can manage it, by sending a write barrier down all relevant
> queues. We can send a zero length write barrier command, yes?

Actually, yes that was indeed one of the things I wanted to achieve with
the block layer rewrite -- the ability to send down other commands than
read/write down the queue. So not exactly bio, but more of a new block
feature.

See, now fs requests have REQ_CMD set in the request flag bits. This
means that it's a "regular" request, which has a string of bios attached
to it. Doing something ala

struct request *rq = get_request();

init_request(rq);
rq->rq_dev = target_dev;
rq->cmd[0] = GPCMD_FLUSH_CACHE;
rq->flags = REQ_PC;
/* additional info... */
queue_request(rq);

would indeed be possible. The attentive reader will now know where
ide-scsi is headed and why :-)

This would work for any SCSI and psueo-SCSI device, basically all the
stuff out there. For IDE, the request pre-handler would transform this
into an IDE command (or taskfile).

--
Jens Axboe