Commit ca9e968a authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc

__f2fs_bio_alloc() won't fail due to memory pool backend, remove unneeded
__GFP_NOFAIL flag in __f2fs_bio_alloc().
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 439dfb10
...@@ -54,17 +54,13 @@ static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask, ...@@ -54,17 +54,13 @@ static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask,
return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset); return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset);
} }
struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail) struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio)
{ {
struct bio *bio; if (noio) {
if (no_fail) {
/* No failure on bio allocation */ /* No failure on bio allocation */
bio = __f2fs_bio_alloc(GFP_NOIO, npages); return __f2fs_bio_alloc(GFP_NOIO, npages);
if (!bio)
bio = __f2fs_bio_alloc(GFP_NOIO | __GFP_NOFAIL, npages);
return bio;
} }
if (time_to_inject(sbi, FAULT_ALLOC_BIO)) { if (time_to_inject(sbi, FAULT_ALLOC_BIO)) {
f2fs_show_injection_info(sbi, FAULT_ALLOC_BIO); f2fs_show_injection_info(sbi, FAULT_ALLOC_BIO);
return NULL; return NULL;
......
...@@ -3341,7 +3341,7 @@ void f2fs_destroy_checkpoint_caches(void); ...@@ -3341,7 +3341,7 @@ void f2fs_destroy_checkpoint_caches(void);
*/ */
int __init f2fs_init_bioset(void); int __init f2fs_init_bioset(void);
void f2fs_destroy_bioset(void); void f2fs_destroy_bioset(void);
struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail); struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio);
int f2fs_init_bio_entry_cache(void); int f2fs_init_bio_entry_cache(void);
void f2fs_destroy_bio_entry_cache(void); void f2fs_destroy_bio_entry_cache(void);
void f2fs_submit_bio(struct f2fs_sb_info *sbi, void f2fs_submit_bio(struct f2fs_sb_info *sbi,
......
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