[Devel] [PATCH RH9 1/2] dm-qcow2: Change call_rw_iter() parameter

Kirill Tkhai ktkhai at virtuozzo.com
Fri Nov 26 18:04:04 MSK 2021


Use "struct qcow2 *" instead "struct file *"

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-qcow2-map.c    |    2 +-
 drivers/md/dm-qcow2-target.c |    3 ++-
 drivers/md/dm-qcow2.h        |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 19b08fd990d5..587068990424 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -1245,7 +1245,7 @@ static void __submit_rw_mapped(struct qcow2 *qcow2, struct qio *qio, u32 nr_segs
 	iov_iter_bvec(&iter, rw, bvec, nr_segs, qio->bi_iter.bi_size);
 	iter.iov_offset = qio->bi_iter.bi_bvec_done;
 
-	call_rw_iter(qcow2->file, pos, rw, &iter, qio);
+	call_rw_iter(qcow2, pos, rw, &iter, qio);
 }
 
 static void submit_rw_mapped(struct qcow2 *qcow2, struct qio *qio)
diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c
index d7ecd79f3376..646a0152fd7b 100644
--- a/drivers/md/dm-qcow2-target.c
+++ b/drivers/md/dm-qcow2-target.c
@@ -95,10 +95,11 @@ static void qcow2_aio_complete(struct kiocb *iocb, long ret, long ret2)
 	qcow2_aio_do_completion(qio);
 }
 
-void call_rw_iter(struct file *file, loff_t pos, unsigned int rw,
+void call_rw_iter(struct qcow2 *qcow2, loff_t pos, unsigned int rw,
 		  struct iov_iter *iter, struct qio *qio)
 {
 	struct kiocb *iocb = &qio->iocb;
+	struct file *file = qcow2->file;
 	int ret;
 
 	iocb->ki_pos = pos;
diff --git a/drivers/md/dm-qcow2.h b/drivers/md/dm-qcow2.h
index 3cb28c459605..b1ae1770ee14 100644
--- a/drivers/md/dm-qcow2.h
+++ b/drivers/md/dm-qcow2.h
@@ -285,7 +285,7 @@ void md_page_erase(struct qcow2 *qcow2, struct md_page *md);
 void free_md_page(struct md_page *md);
 void zero_fill_page_from(struct page *page, unsigned int from);
 int rw_page_sync(unsigned int rw, struct qcow2 *qcow2, u64 index, struct page *page);
-void call_rw_iter(struct file *file, loff_t pos, unsigned int rw,
+void call_rw_iter(struct qcow2 *qcow2, loff_t pos, unsigned int rw,
 		  struct iov_iter *iter, struct qio *qio);
 void calc_cached_parameters(struct qcow2 *qcow2, struct QCowHeader *hdr);
 void slow_wb_timer_fn(struct timer_list *t);




More information about the Devel mailing list