[RHEL7,COMMIT] ploop: Add @id argument to ->autodetect()

Submitted by Vasily Averin on Aug. 25, 2020, 6:04 a.m.

Details

Message ID 202008250604.07P64oSD024638@vz7build.vvs.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Vasily Averin Aug. 25, 2020, 6:04 a.m.
The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.18.2.vz7.163.9
------>
commit 5c4a961d7209b18bb1001f2315d8650021b1805b
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Tue Aug 25 09:04:49 2020 +0300

    ploop: Add @id argument to ->autodetect()
    
    https://jira.sw.ru/browse/PSBM-105347
    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 5499f97..ad1d365 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 54c9954..db3eacd 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 365e2e3..38599e2 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 fe6f94e..2dc0c26 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)