summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2014-07-01 10:36:47 -0600
committerJiri Slaby <jslaby@suse.cz>2014-09-02 11:41:56 +0200
commitc27a4fe151abf351665639eef0ee2fef7e6fb4f9 (patch)
tree7e429e041c935365f4f00a37accfb97e05bd0c02 /include
parentab73940ae61dd855de2965f0d728b803e9ff0546 (diff)
bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload
commit cbcd1054a1fd2aa980fc11ff28e436fc4aaa2d54 upstream. Commit 08778795 ("block: Fix nr_vecs for inline integrity vectors") from Martin introduces the function bip_integrity_vecs(get the useful vectors) to fix the issue about nr_vecs for inline integrity vectors that reported by David Milburn. But it seems that bip_integrity_vecs() will return the wrong number if the bio is not based on any bio_set for some reason(bio->bi_pool == NULL), because in that case, the bip_inline_vecs[0] is malloced directly. So here we add the bip_max_vcnt to record the count of vector slots, and cleanup the function bip_integrity_vecs(). Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Kent Overstreet <kmo@daterainc.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bio.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ec48bac5b039..6c17ad5cc814 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -187,6 +187,7 @@ struct bio_integrity_payload {
unsigned short bip_slab; /* slab the bip came from */
unsigned short bip_vcnt; /* # of integrity bio_vecs */
unsigned short bip_idx; /* current bip_vec index */
+ unsigned short bip_max_vcnt; /* integrity bio_vec slots */
unsigned bip_owns_buf:1; /* should free bip_buf */
struct work_struct bip_work; /* I/O completion */