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>
-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;
{
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;
{
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,
}
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;
{
struct log_writes_c *lc = ti->private;
struct dm_dev *dev = lc->dev;
}
static int multipath_prepare_ioctl(struct dm_target *ti,
}
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;
{
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;
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 */
r = 0;
} else {
/* pg_init has not started or completed */
*
* Passthrough all ioctls to the path for sector 0
*/
*
* 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;
{
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;
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.
/*
* 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;
{
struct dm_verity *v = ti->private;
/*
* Pass on ioctl to the backend device.
*/
/*
* 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;
{
struct dmz_target *dmz = ti->private;
}
static int dm_prepare_ioctl(struct mapped_device *md, int *srcu_idx,
}
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;
__acquires(md->io_barrier)
{
struct dm_target *tgt;
if (dm_suspended_md(md))
return -EAGAIN;
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);
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;
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);
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
- r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+ r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
- r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+ r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
- r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+ r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
{
struct mapped_device *md = bdev->bd_disk->private_data;
const struct pr_ops *ops;
- r = dm_prepare_ioctl(md, &srcu_idx, &bdev, &mode);
+ r = dm_prepare_ioctl(md, &srcu_idx, &bdev);
typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv,
char *result, unsigned maxlen);
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)
/*
* These iteration functions are typically used to check (and combine)