Device-mapper ioctls receive and send data in a buffer supplied by userspace. The buffer has two parts. The first part contains a 'struct dm_ioctl' and has a fixed size. The second part depends on the ioctl and has a variable size. This patch recognises the specific ioctls that do not use the variable part of the buffer and skips allocating memory for it. In particular, when a device is suspended and a resume ioctl is sent, this now avoid memory allocation completely. The variable "struct dm_ioctl tmp" is moved from the function copy_params to its caller ctl_ioctl and renamed to param_kernel. It is used directly when the ioctl function doesn't need any arguments.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -267,9 +267,9 @@ enum { · 266 unmodified lines | ||
| 267 | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
| 268 | 268 | |
| 269 | 269 | #define DM_VERSION_MAJOR 4 |
| 270 | −#define DM_VERSION_MINOR 23 | |
| 271 | −#define DM_VERSION_PATCHLEVEL 1 | |
| 272 | −#define DM_VERSION_EXTRA "-ioctl (2012-12-18)" | |
| 270 | +#define DM_VERSION_MINOR 24 | |
| 271 | +#define DM_VERSION_PATCHLEVEL 0 | |
| 272 | +#define DM_VERSION_EXTRA "-ioctl (2013-01-15)" | |
| 273 | 273 | |
| 274 | 274 | /* Status bits */ |
| 275 | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |