diff options
| author | Kevin Wolf <kwolf@redhat.com> | 2025-04-29 18:50:17 +0200 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2025-05-04 11:35:05 +0200 |
| commit | 4862c8861d902d43645a493e441c4478be1c6c44 (patch) | |
| tree | 9f47c4c4e622c33406e9151943e12ddd20d1369a /drivers/md/dm-flakey.c | |
| parent | 13e79076c89f6e96a6cca8f6df38b40d025907b4 (diff) | |
dm: Allow .prepare_ioctl to handle ioctls directly
This adds a 'bool *forward' parameter to .prepare_ioctl, which allows
device mapper targets to accept ioctls to themselves instead of the
underlying device. If the target already fully handled the ioctl, it
sets *forward to false and device mapper won't forward it to the
underlying device any more.
In order for targets to actually know what the ioctl is about and how to
handle it, pass also cmd and arg.
As long as targets restrict themselves to interpreting ioctls of type
DM_IOCTL, this is a backwards compatible change because previously, any
such ioctl would have been passed down through all device mapper layers
until it reached a device that can't understand the ioctl and would
return an error.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'drivers/md/dm-flakey.c')
| -rw-r--r-- | drivers/md/dm-flakey.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index a8ee3df32d5f..c711db6f8f5c 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -648,7 +648,9 @@ static void flakey_status(struct dm_target *ti, status_type_t type, } } -static int flakey_prepare_ioctl(struct dm_target *ti, struct block_device **bdev) +static int flakey_prepare_ioctl(struct dm_target *ti, struct block_device **bdev, + unsigned int cmd, unsigned long arg, + bool *forward) { struct flakey_c *fc = ti->private; |
