Linux Device Mapper development
 help / color / mirror / Atom feed
From: Andy Grover <agrover@redhat.com>
To: dm-devel@redhat.com
Subject: [PATCH 0/3] poll() for DM events
Date: Mon,  9 Jan 2017 10:20:37 -0800	[thread overview]
Message-ID: <20170109182040.31337-1-agrover@redhat.com> (raw)

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(-)

-- 
2.9.3

             reply	other threads:[~2017-01-09 18:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 18:20 Andy Grover [this message]
2017-01-09 18:20 ` [PATCH 1/3] dm: Change ioctl handlers to take struct file* Andy Grover
2017-01-09 18:20 ` [PATCH 2/3] dm: Add support to poll for dm events Andy Grover
2017-01-10  2:10   ` Andy Grover
2017-01-09 18:20 ` [PATCH 3/3] dm: Allow associated fd to be used for TABLE_STATUS Andy Grover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170109182040.31337-1-agrover@redhat.com \
    --to=agrover@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox