projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35e396c
)
block: add bio_has_data() to detect whether a bio carries data or not
author
Jens Axboe
<jens.axboe@oracle.com>
Fri, 8 Aug 2008 09:17:12 +0000
(11:17 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:00 +0000
(08:56 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
include/linux/bio.h
patch
|
blob
|
blame
|
history
diff --git
a/include/linux/bio.h
b/include/linux/bio.h
index 0933a14e641423f523d8ed7a56ef7f2a6b849e5c..9e93c9299479054aa0273ff65b144c6f161b4719 100644
(file)
--- 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,
__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)]))