git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[safe/jmp/linux-2.6]
/
fs
/
bio-integrity.c
diff --git
a/fs/bio-integrity.c
b/fs/bio-integrity.c
index
49a34e7
..
612a5c3
100644
(file)
--- a/
fs/bio-integrity.c
+++ b/
fs/bio-integrity.c
@@
-24,6
+24,7
@@
#include <linux/mempool.h>
#include <linux/bio.h>
#include <linux/workqueue.h>
#include <linux/mempool.h>
#include <linux/bio.h>
#include <linux/workqueue.h>
+#include <linux/slab.h>
struct integrity_slab {
struct kmem_cache *slab;
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)
{
static inline int use_bip_pool(unsigned int idx)
{
- if (idx == BIOVEC_
NR_POOLS
)
+ if (idx == BIOVEC_
MAX_IDX
)
return 1;
return 0;
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) {
/* 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)) {
bip = mempool_alloc(bs->bio_integrity_pool, gfp_mask);
if (unlikely(bip == NULL)) {