diff options
author | Mike Snitzer <snitzer@redhat.com> | 2018-04-03 16:54:10 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2018-04-04 12:12:39 -0400 |
commit | 5bd5e8d891c1fd2d966a7e2c26f0452d22410683 (patch) | |
tree | a26fa9657db6b9f2faa6805693db282f7bfa052c /drivers/md/dm.c | |
parent | 971888c46993f871f20d02d1fe43486a924fad11 (diff) | |
download | linux-5bd5e8d891c1fd2d966a7e2c26f0452d22410683.tar.bz2 |
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: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index d4438188d088..3af590e0d78c 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -459,7 +459,7 @@ static int dm_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo) } 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; @@ -483,7 +483,7 @@ retry: 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); @@ -505,7 +505,7 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode, 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; @@ -3034,10 +3034,9 @@ static int dm_pr_reserve(struct block_device *bdev, u64 key, enum pr_type type, { 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; @@ -3055,10 +3054,9 @@ static int dm_pr_release(struct block_device *bdev, u64 key, enum pr_type type) { 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; @@ -3077,10 +3075,9 @@ static int dm_pr_preempt(struct block_device *bdev, u64 old_key, u64 new_key, { 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; @@ -3098,10 +3095,9 @@ static int dm_pr_clear(struct block_device *bdev, u64 key) { 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; |