History

dm ioctl: add a new DM_DEV_ARM_POLL ioctl

This ioctl will record the current global event number in the structure dm_file, so that next select or poll call will wait until new events arrived since this ioctl. The DM_DEV_ARM_POLL ioctl has the same effect as closing and reopening the handle. Using the DM_DEV_ARM_POLL ioctl is optional - if the userspace is OK with closing and reopening the /dev/mapper/control handle after select or poll, there is no need to re-arm via ioctl. Usage: 1. open the /dev/mapper/control device 2. send the DM_DEV_ARM_POLL ioctl 3. scan the event numbers of all devices we are interested in and process them 4. call select, poll or epoll on the handle (it waits until some new event happens since the DM_DEV_ARM_POLL ioctl) 5. go to step 2

Mikulas Patocka committed 9 years ago

Commit fc1841e1 parent 93e64422 files · +38 −22Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/dm-ioctl.h+3−1
@@ -240,7 +240,8 @@ enum { · 239 unmodified lines
240240 /* Added later */
241241 DM_LIST_VERSIONS_CMD,
242242 DM_TARGET_MSG_CMD,
243− DM_DEV_SET_GEOMETRY_CMD
243+ DM_DEV_SET_GEOMETRY_CMD,
244+ DM_DEV_ARM_POLL_CMD,
244245 };
245246
246247 #define DM_IOCTL 0xfd
@@ -255,6 +256,7 @@ enum { · 8 unmodified lines
255256 #define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
256257 #define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
257258 #define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
259+#define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, DM_DEV_ARM_POLL_CMD, struct dm_ioctl)
258260
259261 #define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
260262 #define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)