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

Kirill Tkhai ktkhai at virtuozzo.com
Mon Aug 24 19:41:40 MSK 2020


Signed-off-by: Kirill Tkhai <ktkhai at 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(-)

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)




More information about the Devel mailing list