staging: erofs: avoid opened loop codes
Use __GFP_NOFAIL to avoid opened loop codes in z_erofs_vle_unzip(). Signed-off-by: Chao Yu <yuchao0@huawei.com> Reviewed-by: Gao Xiang <gaoxiang25@huawei.com> Link: https://lore.kernel.org/r/20190716094422.110805-1-yuchao0@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
44a22dc3dd
commit
441dfcc886
|
@ -921,18 +921,18 @@ static int z_erofs_vle_unzip(struct super_block *sb,
|
|||
mutex_trylock(&z_pagemap_global_lock))
|
||||
pages = z_pagemap_global;
|
||||
else {
|
||||
repeat:
|
||||
gfp_t gfp_flags = GFP_KERNEL;
|
||||
|
||||
if (nr_pages > Z_EROFS_VLE_VMAP_GLOBAL_PAGES)
|
||||
gfp_flags |= __GFP_NOFAIL;
|
||||
|
||||
pages = kvmalloc_array(nr_pages, sizeof(struct page *),
|
||||
GFP_KERNEL);
|
||||
gfp_flags);
|
||||
|
||||
/* fallback to global pagemap for the lowmem scenario */
|
||||
if (unlikely(!pages)) {
|
||||
if (nr_pages > Z_EROFS_VLE_VMAP_GLOBAL_PAGES)
|
||||
goto repeat;
|
||||
else {
|
||||
mutex_lock(&z_pagemap_global_lock);
|
||||
pages = z_pagemap_global;
|
||||
}
|
||||
mutex_lock(&z_pagemap_global_lock);
|
||||
pages = z_pagemap_global;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue