Re: [RFC] An alternative interface to device mapper

From: Daniel Phillips
Date: Sat Mar 08 2008 - 07:07:00 EST


Hi Pavel,

On Saturday 08 March 2008 03:38, Pavel Machek wrote:
> > Unlike a pipe, there is no waiting for input on a ddlink: if there is
> > nothing to read then the read returns immediately with zero length. If
> > some other behavior is desired it can be obtained using poll.
>
> That's kind of strange, no?

It doesn't feel strange in practice. The ddlink framework itself does
not implement this, the module does (e.g. ddsetup). So you can put a
poll wait in your read method if that suits your interface. It just
does not seem to be useful for ddsetup, which does not produce any
data of the kind that needs an application to sit in a loop waiting for
something to arrive. If there is an application like that, it would
probably want to poll the ddlink anyway, to avoid having a whole thread
dedicated to just that.

Maybe the reason it does not feel strange to omit the wait is, reading
from proc never waits. A ddlink fd is more like proc than like a pipe.
It was Trond who started called his thing a "pipefs", blame him ;-)

> Should not description of interface go to Doc* somewhere?

Yes, will fix.

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