Re: block device/VM question

From: Peter T. Breuer (ptb@it.uc3m.es)
Date: Tue Aug 27 2002 - 14:28:42 EST


"A month of sundays ago Thunder from the hill wrote:"
> > And for the O_DIRECT flag we seem to do alloc_kiovec(1, &f->f_iobuf).
>
> Perhaps we should go biovec here?
>
> For you, if you can stand it you can even go directly into the dio stuff
> from direct-io.c. You'll just need to know what to do. Or you fill your
> information into some underway function.

Yes, the 2.5.31 code looks much much simpler. But you encouraged me to
look at 2.4.19 by pointing out that there has been support since 2.4.10,
so that's what I'm looking at!

I'm sure I'm just missing a couple of methods in some struct. I'll test
a few on the way home in the train. Things look good, just no methods to
do the work when the O_DIRECT flag is set. So I get EINVAL on every
read/write access.

I'm getting the hang of it. At every open of the device I look at the
file pointer that they're opening and check to see if it has an iobuff
field set. If not, I set it (and the O_DIRECT flag if necessary).
At every release of the device, I look at the file they're releasing
and if it has an iobuff field, I free it. I guess I should set a
flag to say "I did it", but for the moment, I guess it's only me
in the driver doing it. Kernel programming would be so much easier
if there were an explanation of what things were for :-).

I'll trace what happens in the generic_read() /write() stuff. They'll
be usiing the iobuf there.

Thanks.

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Aug 31 2002 - 22:00:20 EST