From dc760c6fdefab2318870795ad0d268e0804c8064 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 8 Aug 2008 11:17:12 +0200 Subject: [PATCH] --- yaml --- r: 110442 b: refs/heads/master c: 7a67f63b3233ff28e753854fe27891c44f8588ae h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/bio.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d75d8b408852..e03c378ffea8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 35e396cd100489dfe8f5a76e3613fb8049ffdff3 +refs/heads/master: 7a67f63b3233ff28e753854fe27891c44f8588ae diff --git a/trunk/include/linux/bio.h b/trunk/include/linux/bio.h index 0933a14e6414..9e93c9299479 100644 --- a/trunk/include/linux/bio.h +++ b/trunk/include/linux/bio.h @@ -445,6 +445,14 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) +/* + * Check whether this bio carries any data or not. A NULL bio is allowed. + */ +static inline int bio_has_data(struct bio *bio) +{ + return bio && bio->bi_io_vec != NULL; +} + #if defined(CONFIG_BLK_DEV_INTEGRITY) #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))