]> git.baikalelectronics.ru Git - kernel.git/commit
dm: add basic support for using the select or poll function
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 16 Jan 2017 21:05:59 +0000 (16:05 -0500)
committerMike Snitzer <snitzer@redhat.com>
Mon, 19 Jun 2017 15:03:49 +0000 (11:03 -0400)
commitcc07baede60ce06232aab1d98d4b0fcafc24aead
tree50cb9b89d834e3b3c4e65189d0a3f1f85303cb0b
parent131841ba1cbdc148866f134b42db3623071f5008
dm: add basic support for using the select or poll function

Add the ability to poll on the /dev/mapper/control device.  The select
or poll function waits until any event happens on any dm device since
opening the /dev/mapper/control device.  When select or poll returns the
device as readable, we must close and reopen the device to wait for new
dm events.

Usage:
1. open the /dev/mapper/control device
2. scan the event numbers of all devices we are interested in and process
   them
3. call select, poll or epoll on the handle (it waits until some new event
   happens since opening the device)
4. close the /dev/mapper/control handle
5. go to step 1

The next commit allows to re-arm the polling without closing and
reopening the device.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-core.h
drivers/md/dm-ioctl.c
drivers/md/dm.c