Skip to content

poll() for DM events

Andy Grover dm-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dm: Change ioctl handlers to take struct file*drivers/md/dm-ioctl.c+19 -190 replies
2/3dm: Add support to poll for dm eventsdrivers/md/dm-core.h drivers/md/dm-ioctl.c drivers/md/dm.c +1 more+122 -41 reply
3/3dm: Allow associated fd to be used for TABLE_STATUSdrivers/md/dm-ioctl.c+16 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] poll() for DM events

Hi all,

This patchset allows events for multiple DM devices to be monitored by a single thread, instead of requiring one thread per device. This is made possible by a new ioctl to create an association between an open file descriptor to /dev/mapper/control and a DM device. A program can open and associate multiple times, and then poll() all the fds.

Since we now track something per-fd - the association - our new ioctl handler needs the struct file*. lookup_ioctl() requires all ioctl handlers have the same arguments, so patch 1 changes all ioctl_fns to add this.

Patch 2 implements support, but limits associated fds to just being used with poll(), and the VERSION ioctl.

Patch 3 (optional) shows how we could use the associated device to do additional ioctls without needing to specify the device in the ioctl().

There's also a simple test program at:

https://github.com/agrover/dm-poll-test

Thanks -- Andy

Andy Grover (3):
dm: Change ioctl handlers to take struct file*
dm: Add support to poll for dm events
dm: Allow associated fd to be used for TABLE_STATUS

 drivers/md/dm-core.h          |  10 +++
 drivers/md/dm-ioctl.c         | 149 +++++++++++++++++++++++++++++++++++-------
 drivers/md/dm.c               |  12 ++++
 include/uapi/linux/dm-ioctl.h |   6 +-
 4 files changed, 151 insertions(+), 26 deletions(-)
Signature · 1 line
2.9.3