]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Device-mapper ioctls receive and send data in a buffer supplied
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 13 Feb 2013 22:42:39 +0000 (09:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 13 Feb 2013 22:42:39 +0000 (09:42 +1100)
commit41bc568643139e3e4423b4be926df1fa159b9008
treeac8b7529f688721aab37d25372c15f42c04addcf
parent91e50cd641bdd1f0d052cc54c84866356f2869cc
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.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-ioctl.c
include/uapi/linux/dm-ioctl.h