diff options
| -rw-r--r-- | drivers/md/raid5.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index f78b1964543b..ed8e34153c3d 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
| @@ -497,7 +497,7 @@ static void shrink_buffers(struct stripe_head *sh) | |||
| 497 | } | 497 | } |
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | static int grow_buffers(struct stripe_head *sh) | 500 | static int grow_buffers(struct stripe_head *sh, gfp_t gfp) |
| 501 | { | 501 | { |
| 502 | int i; | 502 | int i; |
| 503 | int num = sh->raid_conf->pool_size; | 503 | int num = sh->raid_conf->pool_size; |
| @@ -505,7 +505,7 @@ static int grow_buffers(struct stripe_head *sh) | |||
| 505 | for (i = 0; i < num; i++) { | 505 | for (i = 0; i < num; i++) { |
| 506 | struct page *page; | 506 | struct page *page; |
| 507 | 507 | ||
| 508 | if (!(page = alloc_page(GFP_KERNEL))) { | 508 | if (!(page = alloc_page(gfp))) { |
| 509 | return 1; | 509 | return 1; |
| 510 | } | 510 | } |
| 511 | sh->dev[i].page = page; | 511 | sh->dev[i].page = page; |
| @@ -1963,10 +1963,10 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) | |||
| 1963 | put_cpu(); | 1963 | put_cpu(); |
| 1964 | } | 1964 | } |
| 1965 | 1965 | ||
| 1966 | static int grow_one_stripe(struct r5conf *conf, int hash) | 1966 | static int grow_one_stripe(struct r5conf *conf, int hash, gfp_t gfp) |
| 1967 | { | 1967 | { |
| 1968 | struct stripe_head *sh; | 1968 | struct stripe_head *sh; |
| 1969 | sh = kmem_cache_zalloc(conf->slab_cache, GFP_KERNEL); | 1969 | sh = kmem_cache_zalloc(conf->slab_cache, gfp); |
| 1970 | if (!sh) | 1970 | if (!sh) |
| 1971 | return 0; | 1971 | return 0; |
| 1972 | 1972 | ||
| @@ -1974,7 +1974,7 @@ static int grow_one_stripe(struct r5conf *conf, int hash) | |||
| 1974 | 1974 | ||
| 1975 | spin_lock_init(&sh->stripe_lock); | 1975 | spin_lock_init(&sh->stripe_lock); |
| 1976 | 1976 | ||
| 1977 | if (grow_buffers(sh)) { | 1977 | if (grow_buffers(sh, gfp)) { |
| 1978 | shrink_buffers(sh); | 1978 | shrink_buffers(sh); |
| 1979 | kmem_cache_free(conf->slab_cache, sh); | 1979 | kmem_cache_free(conf->slab_cache, sh); |
| 1980 | return 0; | 1980 | return 0; |
| @@ -2016,7 +2016,7 @@ static int grow_stripes(struct r5conf *conf, int num) | |||
| 2016 | conf->pool_size = devs; | 2016 | conf->pool_size = devs; |
| 2017 | hash = conf->max_nr_stripes % NR_STRIPE_HASH_LOCKS; | 2017 | hash = conf->max_nr_stripes % NR_STRIPE_HASH_LOCKS; |
| 2018 | while (num--) { | 2018 | while (num--) { |
| 2019 | if (!grow_one_stripe(conf, hash)) | 2019 | if (!grow_one_stripe(conf, hash, GFP_KERNEL)) |
| 2020 | return 1; | 2020 | return 1; |
| 2021 | conf->max_nr_stripes++; | 2021 | conf->max_nr_stripes++; |
| 2022 | hash = (hash + 1) % NR_STRIPE_HASH_LOCKS; | 2022 | hash = (hash + 1) % NR_STRIPE_HASH_LOCKS; |
| @@ -5841,7 +5841,7 @@ raid5_set_cache_size(struct mddev *mddev, int size) | |||
| 5841 | return err; | 5841 | return err; |
| 5842 | hash = conf->max_nr_stripes % NR_STRIPE_HASH_LOCKS; | 5842 | hash = conf->max_nr_stripes % NR_STRIPE_HASH_LOCKS; |
| 5843 | while (size > conf->max_nr_stripes) { | 5843 | while (size > conf->max_nr_stripes) { |
| 5844 | if (grow_one_stripe(conf, hash)) | 5844 | if (grow_one_stripe(conf, hash, GFP_KERNEL)) |
| 5845 | conf->max_nr_stripes++; | 5845 | conf->max_nr_stripes++; |
| 5846 | else break; | 5846 | else break; |
| 5847 | hash = (hash + 1) % NR_STRIPE_HASH_LOCKS; | 5847 | hash = (hash + 1) % NR_STRIPE_HASH_LOCKS; |
