[RH7,1/2] ploop: Add @id argument to ->autodetect()

Submitted by Kirill Tkhai on Aug. 24, 2020, 4:41 p.m.

Details

Message ID 159828729972.128627.14732924544769183413.stgit@localhost.localdomain
State New
Series "Series without cover letter"
Headers show

Commit Message

Kirill Tkhai Aug. 24, 2020, 4:41 p.m.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/io.c        |    2 +-
 drivers/block/ploop/io_direct.c |    2 +-
 drivers/block/ploop/io_kaio.c   |    2 +-
 include/linux/ploop/ploop.h     |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/io.c b/drivers/block/ploop/io.c
index 5499f9781151..ad1d365d7c6c 100644
--- a/drivers/block/ploop/io.c
+++ b/drivers/block/ploop/io.c
@@ -43,7 +43,7 @@  static struct ploop_io_ops * ploop_io_get(struct ploop_io *io, unsigned int id)
 	mutex_lock(&ploop_ios_mutex);
 	list_for_each_entry(ops, &ploop_ios, list) {
 		if ((id == ops->id || id == PLOOP_IO_AUTO) &&
-		    !ops->autodetect(io) && try_module_get(ops->owner)) {
+		    !ops->autodetect(io, id) && try_module_get(ops->owner)) {
 			mutex_unlock(&ploop_ios_mutex);
 			return ops;
 		}
diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index 54c995411c45..db3eacd2d845 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -1711,7 +1711,7 @@  static int dio_dump(struct ploop_io * io)
 	return -1;
 }
 
-static int dio_autodetect(struct ploop_io * io)
+static int dio_autodetect(struct ploop_io *io, unsigned int id)
 {
 	struct file  * file  = io->files.file;
 	struct inode * inode = file->f_mapping->host;
diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index 365e2e3850d4..38599e201163 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -1208,7 +1208,7 @@  static void kaio_issue_flush(struct ploop_io * io, struct ploop_request *preq)
 	spin_unlock_irq(&io->plo->lock);
 }
 
-static int kaio_autodetect(struct ploop_io * io)
+static int kaio_autodetect(struct ploop_io *io, unsigned int id)
 {
 	struct file  * file  = io->files.file;
 	struct inode * inode = file->f_mapping->host;
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index fe6f94ef550c..2dc0c2690490 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -208,7 +208,7 @@  struct ploop_io_ops
 	loff_t  (*i_size_read)(struct ploop_io*);
 	fmode_t (*f_mode)(struct ploop_io*);
 
-	int     (*autodetect)(struct ploop_io * io);
+	int     (*autodetect)(struct ploop_io *io, unsigned int id);
 };
 
 static inline loff_t generic_i_size_read(struct ploop_io *io)