}
 }
 
-static int flakey_prepare_ioctl(struct dm_target *ti,
-               struct block_device **bdev, fmode_t *mode)
+static int flakey_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
 {
        struct flakey_c *fc = ti->private;
 
 
        }
 }
 
-static int linear_prepare_ioctl(struct dm_target *ti,
-               struct block_device **bdev, fmode_t *mode)
+static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
 {
        struct linear_c *lc = (struct linear_c *) ti->private;
        struct dm_dev *dev = lc->dev;
 
 }
 
 static int log_writes_prepare_ioctl(struct dm_target *ti,
-               struct block_device **bdev, fmode_t *mode)
+                                   struct block_device **bdev)
 {
        struct log_writes_c *lc = ti->private;
        struct dm_dev *dev = lc->dev;
 
 }
 
 static int multipath_prepare_ioctl(struct dm_target *ti,
-               struct block_device **bdev, fmode_t *mode)
+                                  struct block_device **bdev)
 {
        struct multipath *m = ti->private;
        struct pgpath *current_pgpath;
        if (current_pgpath) {
                if (!test_bit(MPATHF_QUEUE_IO, &m->flags)) {
                        *bdev = current_pgpath->path.dev->bdev;
-                       *mode = current_pgpath->path.dev->mode;
                        r = 0;
                } else {
                        /* pg_init has not started or completed */
 
  *
  * Passthrough all ioctls to the path for sector 0
  */
-static int switch_prepare_ioctl(struct dm_target *ti,
-               struct block_device **bdev, fmode_t *mode)
+static int switch_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
 {
        struct switch_ctx *sctx = ti->private;
        unsigned path_nr;
        path_nr = switch_get_path_nr(sctx, 0);
 
        *bdev = sctx->path_list[path_nr].dmdev->bdev;
-       *mode = sctx->path_list[path_nr].dmdev->mode;
 
        /*
         * Only pass ioctls through if the device sizes match exactly.
 
        }
 }
 
-static int verity_prepare_ioctl(struct dm_target *ti,
-               struct block_device **bdev, fmode_t *mode)
+static int verity_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
 {
        struct dm_verity *v = ti->private;
 
 
 /*
  * Pass on ioctl to the backend device.
  */
-static int dmz_prepare_ioctl(struct dm_target *ti,
-                            struct block_device **bdev, fmode_t *mode)
+static int dmz_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
 {
        struct dmz_target *dmz = ti->private;
 
 
 }
 
 static int dm_prepare_ioctl(struct mapped_device *md, int *srcu_idx,
-                           struct block_device **bdev, fmode_t *mode)
+                           struct block_device **bdev)
        __acquires(md->io_barrier)
 {
        struct dm_target *tgt;
        if (dm_suspended_md(md))
                return -EAGAIN;
 
-       r = tgt->type->prepare_ioctl(tgt, bdev, mode);
+       r = tgt->type->prepare_ioctl(tgt, bdev);
        if (r == -ENOTCONN && !fatal_signal_pending(current)) {
                dm_put_live_table(md, *srcu_idx);
                msleep(10);
        struct mapped_device *md = bdev->bd_disk->private_data;
        int r, srcu_idx;
 
-       r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+       r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
        if (r < 0)
                goto out;
 
 {
        struct mapped_device *md = bdev->bd_disk->private_data;
        const struct pr_ops *ops;
-       fmode_t mode;
        int r, srcu_idx;
 
-       r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+       r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
        if (r < 0)
                goto out;
 
 {
        struct mapped_device *md = bdev->bd_disk->private_data;
        const struct pr_ops *ops;
-       fmode_t mode;
        int r, srcu_idx;
 
-       r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+       r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
        if (r < 0)
                goto out;
 
 {
        struct mapped_device *md = bdev->bd_disk->private_data;
        const struct pr_ops *ops;
-       fmode_t mode;
        int r, srcu_idx;
 
-       r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+       r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
        if (r < 0)
                goto out;
 
 {
        struct mapped_device *md = bdev->bd_disk->private_data;
        const struct pr_ops *ops;
-       fmode_t mode;
        int r, srcu_idx;
 
-       r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+       r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
        if (r < 0)
                goto out;
 
 
 typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv,
                              char *result, unsigned maxlen);
 
-typedef int (*dm_prepare_ioctl_fn) (struct dm_target *ti,
-                           struct block_device **bdev, fmode_t *mode);
+typedef int (*dm_prepare_ioctl_fn) (struct dm_target *ti, struct block_device **bdev);
 
 /*
  * These iteration functions are typically used to check (and combine)