bio: sizeof pointer instead of size of the pointed-to type?
PATCH 1/1 bio: sizeof pointer instead of size of the pointed-to type?
Do not take the size of a pointer to determine the size of the pointed-to type
Signed-off-by Roel Kluin <[email protected]>
---
This is not yet tested. Is it correct?
fs/bio.c +1 -1
@@ -96,7 +96,7 @@ static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size)if (bio_slab_nr == bio_slab_max && entry ==-1 ) { bio_slab_max <<=1 ; bio_slabs =krealloc (bio_slabs, - bio_slab_max *sizeof (struct bio_slab ), + bio_slab_max *sizeof (struct bio_slab *),GFP_KERNEL );if (!bio_slabs) goto out_unlock;
[Roel Kluin - Wed, Jul 15, 2009 at 04:00:46PM +0200]
| | Do not take the size of a pointer to determine the size of the pointed-to type | | Signed-off-by: Roel Kluin <[email protected]> | --- | This is not yet tested. Is it correct? |
Hi Roel,
as far as I see -- no, it should be not changed at all. You manage with whole structures not pointers.
-- Cyrill
Quoted 11 lines · Roel Kluin
Do not take the size of a pointer to determine the size of the pointed-to type
Signed-off-by Roel Kluin <[email protected]>---
This is not yet tested. Is it correct?fs/bio.c +0
-0
fs/bio.c static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size) · line 102
Quoted 8 lines
fs/bio.c +1
-1@@ -96,7 +96,7 @@ static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size)if (bio_slab_nr == bio_slab_max && entry ==-1 ) { bio_slab_max <<=1 ; bio_slabs =krealloc (bio_slabs, - bio_slab_max *sizeof (struct bio_slab ), + bio_slab_max *sizeof (struct bio_slab *),GFP_KERNEL );if (!bio_slabs) goto out_unlock;
NAK. The code is correct as-is.
Cheers,
Jeff