aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/bio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 0933a14e6414..9e93c9299479 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -445,6 +445,14 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
445 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 445 __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
446#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 446#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
447 447
448/*
449 * Check whether this bio carries any data or not. A NULL bio is allowed.
450 */
451static inline int bio_has_data(struct bio *bio)
452{
453 return bio && bio->bi_io_vec != NULL;
454}
455
448#if defined(CONFIG_BLK_DEV_INTEGRITY) 456#if defined(CONFIG_BLK_DEV_INTEGRITY)
449 457
450#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) 458#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))