linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)
@ 2017-11-07 21:45 Mikulas Patocka
  2017-11-08  9:47 ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Mikulas Patocka @ 2017-11-07 21:45 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, dm-devel

Hi

I need the function bio_kmap_irq in the driver that I am developing, but 
it doesn't return the size of the mapped data. I've made this patch to fix 
it.

Mikulas


From: Mikulas Patocka <mpatocka@redhat.com>

The function bio_kmap_irq is not usable because it does not return the
size of the mapped data.

Fix bio_kmap_irq and __bio_kmap_irq so that they return the size of
mapped data.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 include/linux/bio.h |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6/include/linux/bio.h
===================================================================
--- linux-2.6.orig/include/linux/bio.h
+++ linux-2.6/include/linux/bio.h
@@ -576,14 +576,16 @@ static inline void bvec_kunmap_irq(char
 #endif
 
 static inline char *__bio_kmap_irq(struct bio *bio, struct bvec_iter iter,
-				   unsigned long *flags)
+				   unsigned long *flags, unsigned *size)
 {
-	return bvec_kmap_irq(&bio_iter_iovec(bio, iter), flags);
+	struct bio_vec bv = bio_iter_iovec(bio, iter);
+	*size = bv.bv_len;
+	return bvec_kmap_irq(&bv, flags);
 }
 #define __bio_kunmap_irq(buf, flags)	bvec_kunmap_irq(buf, flags)
 
-#define bio_kmap_irq(bio, flags) \
-	__bio_kmap_irq((bio), (bio)->bi_iter, (flags))
+#define bio_kmap_irq(bio, flags, size) \
+	__bio_kmap_irq((bio), (bio)->bi_iter, (flags), (size))
 #define bio_kunmap_irq(buf,flags)	__bio_kunmap_irq(buf, flags)
 
 /*

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-08 18:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 21:45 [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd) Mikulas Patocka
2017-11-08  9:47 ` Christoph Hellwig
2017-11-08 12:38   ` Mikulas Patocka
2017-11-08 15:05     ` Christoph Hellwig
2017-11-08 15:20       ` Jens Axboe
2017-11-08 15:34         ` [dm-devel] " Christoph Hellwig
2017-11-08 15:36           ` Jens Axboe
2017-11-08 18:03             ` Christoph Hellwig
2017-11-08 18:08               ` Jens Axboe
2017-11-08 18:09                 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).