poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] ios: Introduce ios_flush and ios_dev_<...>_flush.


From: Jose E. Marchesi
Subject: Re: [PATCH 1/2] ios: Introduce ios_flush and ios_dev_<...>_flush.
Date: Sun, 10 May 2020 19:44:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Ege!
Thanks for the patch.

    +/* If the current IOD is a write stream, write out the data in the buffer
    +   till OFFSET.  If the current IOD is a stream IOD, free (if allowed by 
the
    +   embedded buffering strategy) bytes up to OFFSET.  This function has no
    +   impact when called on other IO devices.  */
    +
    +int ios_flush (ios io, ios_off offset)
    +  __attribute__ ((visibility ("hidden")));

In poke regular (non-stream) IO spaces are currently not buffered,
meaning the data is immediately written to the underlying device once a
write operation is issued.

Therefore, I would expect that a write to an output stream IOS would
actually write everything up to that offset, including the data written.

Note I'm not questioning the pertinence of being able to apply ios_flush
to an output stream, that may be useful by itself.

But I wonder about the language-level construct, i.e.:

Should we have a "forget" operation that calls ios_flush only on read
streams and that is a NOP on any other kind of IO spaces including write
streams?

Or should we have a "flush" operation that can be called on both input
and output streams?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]