aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 52b9cbc3e4da..e54305cacc98 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -386,9 +386,28 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
386/* 386/*
387 * Check whether this bio carries any data or not. A NULL bio is allowed. 387 * Check whether this bio carries any data or not. A NULL bio is allowed.
388 */ 388 */
389static inline int bio_has_data(struct bio *bio) 389static inline bool bio_has_data(struct bio *bio)
390{ 390{
391 return bio && bio->bi_io_vec != NULL; 391 if (bio && bio->bi_vcnt)
392 return true;
393
394 return false;
395}
396
397static inline bool bio_is_rw(struct bio *bio)
398{
399 if (!bio_has_data(bio))
400 return false;
401
402 return true;
403}
404
405static inline bool bio_mergeable(struct bio *bio)
406{
407 if (bio->bi_rw & REQ_NOMERGE_FLAGS)
408 return false;
409
410 return true;
392} 411}
393 412
394/* 413/*