X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fbio-integrity.c;h=612a5c38d3c1a5fc49e0d0990e19550c27217650;hb=d28619f1563140526e2f84eae436f39206f40a69;hp=49a34e7f7306d49af72b6d84fda277b82d01cc01;hpb=7878cba9f0037f5599004b03a1260b32d9050360;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c index 49a34e7..612a5c3 100644 --- a/fs/bio-integrity.c +++ b/fs/bio-integrity.c @@ -24,6 +24,7 @@ #include #include #include +#include struct integrity_slab { struct kmem_cache *slab; @@ -61,7 +62,7 @@ static inline unsigned int vecs_to_idx(unsigned int nr) static inline int use_bip_pool(unsigned int idx) { - if (idx == BIOVEC_NR_POOLS) + if (idx == BIOVEC_MAX_IDX) return 1; return 0; @@ -95,6 +96,7 @@ struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio, /* Use mempool if lower order alloc failed or max vecs were requested */ if (bip == NULL) { + idx = BIOVEC_MAX_IDX; /* so we free the payload properly later */ bip = mempool_alloc(bs->bio_integrity_pool, gfp_mask); if (unlikely(bip == NULL)) {