On Sun, Sep 10, 2000 at 01:18:40PM -0700, Ion Badulescu wrote:
> In article <[EMAIL PROTECTED]> you wrote:
> > Can I ask a stupid question: why do we pass a pointer to the file
> > position along with the file when calling read/write methods as in:
> >
> > read(file, buf, count, &file->f_pos)
> >
> > Is there ever a case when we don't want to use the f_pos from the file
> > struct?
>
> Yes: pread()/pwrite().
>
> BTW, they've caused us quite a bit of trouble in the stacking fs code.
> We need to detect if the VFS code calling us is read() or pread(), in
> order to know how to call our own underlying fs method. The only --
> and very unclean -- way we can detect this is by comparing the fpos
> pointer passed to us to the address of file->fpos...
>
> Passing an update_fpos boolean would be so much cleaner.
An update_fpos boolean only would require that pread/pwrite create their own
file structure to pass in the user offset.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]