add poll notification support#140
Conversation
de00d33 to
66c617d
Compare
|
Thanks for the MR! I only just replied on the issue tracker :-). |
There was a problem hiding this comment.
Pull request overview
This PR exposes libfuse low-level poll(2) readiness support through pyfuse3, allowing filesystems to implement Operations.poll() and later wake blocked poll/select/epoll waiters via notify_poll().
Changes:
- Wire up the libfuse low-level
pollcallback and reply path (fuse_ops.poll→fuse_poll→Operations.poll→fuse_reply_poll). - Introduce a
PollHandleopaque type plusnotify_poll(handle)to deliver readiness notifications. - Add an integration test filesystem and test case covering poll notification behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/test_fs.py |
Adds a pollable test file and an integration test validating wakeup via notify_poll. |
src/pyfuse3/internal.pxi |
Registers the new low-level poll handler in fuse_lowlevel_ops. |
src/pyfuse3/handlers.pxi |
Implements fuse_poll/fuse_poll_async bridging to Operations.poll and replies with fuse_reply_poll. |
src/pyfuse3/_pyfuse3.py |
Adds the Operations.poll() API and its documentation. |
src/pyfuse3/__init__.pyx |
Adds PollHandle and the notify_poll() API. |
src/pyfuse3/__init__.pyi |
Updates typing stubs for PollHandle and notify_poll(). |
Include/fuse_lowlevel.pxd |
Declares low-level poll op, fuse_reply_poll, and fuse_lowlevel_notify_poll. |
Include/fuse_common.pxd |
Declares fuse_pollhandle and fuse_pollhandle_destroy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Nikratio
left a comment
There was a problem hiding this comment.
Just one small idea to make it even nicer, but it's good to merge with and without that.
|
@Nikratio thanks for your help with this one! I will split this into a few commits once you give me all OK. |
|
I think this can all go in one commit. |
Expose libfuse low-level poll support through pyfuse3 so that filesystems can implement readiness notifications for poll(2), select(2) and epoll_wait(2). Add bindings for struct fuse_pollhandle, fuse_reply_poll(), fuse_lowlevel_notify_poll() and fuse_pollhandle_destroy(). Introduce a Python PollHandle wrapper with a notify() method to allow a filesystem to retain the poll handle provided by Operations.poll() and notify it later when readiness changes. Wire the low-level FUSE poll callback into Operations.poll(), returning the current readiness mask to the kernel. The default implementation continues to raise -ENOSYS so existing filesystems keep the previous fallback behaviour unless they opt-in. This is needed by filesystems that emulate pollable kernel interfaces, such as sysfs GPIO value files, where edge events must wake userspace processes waiting for POLLPRI. Fixes: libfuse#139 Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
f7f9a5e to
f15e109
Compare
|
Thanks, squashed into a single commit. Once merged, is it possible to please release a new version soonish? |
Tried today, but run into some unexpected issues with generating the documentation ( |
Expose libfuse low-level poll support through pyfuse3.