Description
It's not clear how a FUSE or CUSE device should implement blocking vs non-blocking reads and writes. (This is probably more important for a CUSE device with sporadic read data or bandwidth-limited write data.)
I asked about this earlier on StackOverflow for CUSE: Linux CUSE: How to implement blocking or non-blocking operation.
My conclusion was that the CUSE read and write functions should check fi->flags & O_NONBLOCK
and behave differently depending on whether the bit is set or not.
It would be good to have documentation and examples to address this design question.
For blocking operation, I assume use of pthread_cond_wait()
and pthread_cond_signal()
is a likely implementation strategy. Meanwhile, it appears that the implementation of .poll
functionality requires the use of struct fuse_pollhandle
pointers and fuse_notify_poll()
. Is there some way to use a single mechanism to achieve both, or is it necessary for both to be used in a fully-functional CUSE driver?