summaryrefslogtreecommitdiff
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2014-07-19 04:24:18 +0900
committerKukjin Kim <kgene.kim@samsung.com>2014-07-19 04:24:18 +0900
commita7a30232df01db886473324050d79c3122937c78 (patch)
tree76323b745b44b792173575843a72a2f6baa8a6da /include/linux/bio.h
parentf86e0add813a3cc0e338089fa6c0928f5f6dc52d (diff)
parentfce9e5bb25264153f9f002eada41757118d25ba9 (diff)
Merge branch 'v3.17-next/cleanup-samsung' into v3.17-next/dt-s5pv210
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5a645769f020..d2633ee099d9 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -186,6 +186,15 @@ static inline void *bio_data(struct bio *bio)
#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \
__BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q)))
+/*
+ * Check if adding a bio_vec after bprv with offset would create a gap in
+ * the SG list. Most drivers don't care about this, but some do.
+ */
+static inline bool bvec_gap_to_prev(struct bio_vec *bprv, unsigned int offset)
+{
+ return offset || ((bprv->bv_offset + bprv->bv_len) & (PAGE_SIZE - 1));
+}
+
#define bio_io_error(bio) bio_endio((bio), -EIO)
/*
@@ -644,10 +653,6 @@ struct biovec_slab {
#if defined(CONFIG_BLK_DEV_INTEGRITY)
-
-
-#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
-
#define bip_for_each_vec(bvl, bip, iter) \
for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter)