Commit 7a88fa19 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

block: make nr_iovecs unsigned in bio_alloc_bioset()

There isn't a bug here, but Smatch is not smart enough to know that
"nr_iovecs" can't be negative so it complains about underflows.
Really, it's slightly cleaner to make this parameter unsigned.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent a4d907b6
...@@ -427,7 +427,8 @@ static void punt_bios_to_rescuer(struct bio_set *bs) ...@@ -427,7 +427,8 @@ static void punt_bios_to_rescuer(struct bio_set *bs)
* RETURNS: * RETURNS:
* Pointer to new bio on success, NULL on failure. * Pointer to new bio on success, NULL on failure.
*/ */
struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned int nr_iovecs,
struct bio_set *bs)
{ {
gfp_t saved_gfp = gfp_mask; gfp_t saved_gfp = gfp_mask;
unsigned front_pad; unsigned front_pad;
......
...@@ -383,7 +383,7 @@ extern struct bio_set *bioset_create_nobvec(unsigned int, unsigned int); ...@@ -383,7 +383,7 @@ extern struct bio_set *bioset_create_nobvec(unsigned int, unsigned int);
extern void bioset_free(struct bio_set *); extern void bioset_free(struct bio_set *);
extern mempool_t *biovec_create_pool(int pool_entries); extern mempool_t *biovec_create_pool(int pool_entries);
extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *);
extern void bio_put(struct bio *); extern void bio_put(struct bio *);
extern void __bio_clone_fast(struct bio *, struct bio *); extern void __bio_clone_fast(struct bio *, struct bio *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment