Re: [PATCH] rust: add task_work abstraction

Ashutosh Desai
2026-04-22T00:31:20Z

On Tue, Apr 21, 2026 at 08:44:01AM +0200, Greg KH wrote:
> Do you have a user for this binding so that we can see how it is being
> used to determine if it is correct?

The motivating user is drivers/android/binder/deferred_close.rs, which
calls bindings::init_task_work() and bindings::task_work_add() directly.

Converting it is non-trivial - the current code schedules the task work
before closing the fd on purpose, so it can bail out if scheduling fails
without having already removed the fd. Our API requires the data to be
ready before calling add(), which would reverse that order and change the
error semantics of close_fd().

Happy to send a v2 with a conversion patch if that is the preferred
approach, or to discuss the design first if needed.

Thanks,
Ashutosh