• Jens Axboe's avatar
    [PATCH] make bio->bi_max contain max vec entries · 60ac3a30
    Jens Axboe authored
    This changes the way we do pool lookups when freeing a bio.  Right now
    we use bi_max as a handle into bvec_array[], to find the pool where it
    came from.  This used to be just fine, because if you had a private bio,
    you could specify your own destructor.  But now we have bio_add_page()
    which also needs to know where the bio came from, or more precisely, it
    needs to know how many entries the bio can hold.
    
    So I've changed bi_max to bi_max_vecs, it now contains the number of vec
    entries in the bio. Privately allocated bio's (or on stack) can now just
    set bio->bi_max_vecs to reflect the max size. The pool index for the
    default destructor is stored in the top bits of bi_flags.
    60ac3a30
bio.c 15.4 KB