|
@@ -114,6 +114,14 @@ void bio_integrity_free(struct bio *bio)
|
|
|
}
|
|
|
EXPORT_SYMBOL(bio_integrity_free);
|
|
|
|
|
|
+static inline unsigned int bip_integrity_vecs(struct bio_integrity_payload *bip)
|
|
|
+{
|
|
|
+ if (bip->bip_slab == BIO_POOL_NONE)
|
|
|
+ return BIP_INLINE_VECS;
|
|
|
+
|
|
|
+ return bvec_nr_vecs(bip->bip_slab);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* bio_integrity_add_page - Attach integrity metadata
|
|
|
* @bio: bio to update
|
|
@@ -129,7 +137,7 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
|
|
|
struct bio_integrity_payload *bip = bio->bi_integrity;
|
|
|
struct bio_vec *iv;
|
|
|
|
|
|
- if (bip->bip_vcnt >= bvec_nr_vecs(bip->bip_slab)) {
|
|
|
+ if (bip->bip_vcnt >= bip_integrity_vecs(bip)) {
|
|
|
printk(KERN_ERR "%s: bip_vec full\n", __func__);
|
|
|
return 0;
|
|
|
}
|