bio: make bio_kmap_irq return the size of mapped data The function bio_kmap_irq is not used anywhere in the kernel. The function is not unuseable because it does not return the size of the mapped data. This patch fixes bio_kmap_irq and __bio_kmap_irq so that they return the size of mapped data, so that they can be used, Signed-off-by: Mikulas Patocka --- include/linux/bio.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) Index: linux-4.5/include/linux/bio.h =================================================================== --- linux-4.5.orig/include/linux/bio.h +++ linux-4.5/include/linux/bio.h @@ -579,14 +579,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) /*