Re: block device/VM question

From: Peter T. Breuer (ptb@it.uc3m.es)
Date: Tue Aug 27 2002 - 13:40:44 EST


"ago ptb wrote:"
> In dentry_open(), we get a struct file f = get_empty_filp(), and then
> fill out various of its fields with enormously obscure things. And for
> the O_DIRECT flag we seem to do alloc_kiovec(1, &f->f_iobuf).
>
> I feel that the latter is all I want to do, and the question is to what,
> where (I'll clean up on release). Do I do this every time the devices
> _open() function is called? Or just once, and what do I do it to? I
> should do it to the struct file that gets passed into to the driver
> open()? I'll try that. And set the flag.

Well, that was fun! I checked that on entry into the devices
open function, the file->f_iobuf field was null, and then called
alloc_kiovec on it while I set the O_DIRECT flag on file-_f_flags.

The result was that all read/write calls on the device failed
with EINVAL! Whee!

But ioctls worked. Apparently I am supposed to fill out
some more fields of something else with some methods. Hmm. OK.
I'll look. I guess this will be the a_ops field of i_mapping.

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