Commit 5bd5e8d8 authored by Mike Snitzer's avatar Mike Snitzer
Browse files

dm: remove fmode_t argument from .prepare_ioctl hook



Use the fmode_t that is passed to dm_blk_ioctl() rather than
inconsistently (varies across targets) drop it on the floor by
overriding it with the fmode_t stored in 'struct dm_dev'.

All the persistent reservation functions weren't using the fmode_t they
got back from .prepare_ioctl so remove them.

Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 971888c4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -442,8 +442,7 @@ 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, fmode_t *mode)
static int flakey_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
{
	struct flakey_c *fc = ti->private;

+1 −2
Original line number Diff line number Diff line
@@ -130,8 +130,7 @@ static void linear_status(struct dm_target *ti, status_type_t type,
	}
}

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;
+1 −1
Original line number Diff line number Diff line
@@ -864,7 +864,7 @@ static void log_writes_status(struct dm_target *ti, status_type_t type,
}

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;
+1 −2
Original line number Diff line number Diff line
@@ -1876,7 +1876,7 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv,
}

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;
@@ -1889,7 +1889,6 @@ static int multipath_prepare_ioctl(struct dm_target *ti,
	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 */
+1 −3
Original line number Diff line number Diff line
@@ -512,8 +512,7 @@ static void switch_status(struct dm_target *ti, status_type_t type,
 *
 * 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;
@@ -521,7 +520,6 @@ static int switch_prepare_ioctl(struct dm_target *ti,
	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.
Loading