Skip to contentSkip to conversation

linux-user: Convert blkpg to use a special subop handler

PATCH New Alexander Graf 1 participant 1 message Aug 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Convert blkpg to use a special subop handler

The blkpg ioctl can take different payloads depending on the opcode in its payload structure. Create a new special ioctl handler that can only deal with partition style ones for now.

This patch fixes running parted for me.

---
 linux-user/ioctls.h        |  3 ++-
 linux-user/syscall.c       | 53 ++++++++++++++++++++++++++++++++++++++++++++++
 linux-user/syscall_types.h |  2 +-
 3 files changed, 56 insertions(+), 2 deletions(-)
linux-user/ioctls.h +2 -1
index 609b27c..e672655 100644
@@ -78,7 +78,8 @@
      IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG))
      IOCTL(BLKSSZGET, IOC_R, MK_PTR(TYPE_LONG))
      IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT))
-     IOCTL(BLKPG, IOC_W, MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg)))
+     IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg,
+                   MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg)))
 #ifdef FIBMAP
      IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
 #endif
linux-user/syscall.c +53 -0

59 lines not on this page · raw message

linux-user/syscall_types.h +1 -1
index 9d0c92d..1fd4ee0 100644
@@ -252,4 +252,4 @@ STRUCT(blkpg_ioctl_arg,
        TYPE_INT, /* op */
        TYPE_INT, /* flags */
        TYPE_INT, /* datalen */
-       MK_PTR(MK_STRUCT(STRUCT_blkpg_partition))) /* data */
+       TYPE_PTRVOID) /* data */
Signature · 1 line
1.7.12.4