f2fs: remove unneeded check for error allocating bio_post_read_ctx
Eric Biggers
maintainerPATCH 1/1 f2fs: remove unneeded check for error allocating bio_post_read_ctx
From: Eric Biggers <[email protected]>
Since allocating an object from a mempool never fails when __GFP_DIRECT_RECLAIM (which is included in GFP_NOFS) is set, the check for failure to allocate a bio_post_read_ctx is unnecessary. Remove it.
Signed-off-by Eric Biggers <[email protected]>
--- fs/f2fs/data.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
fs/f2fs/data.c +1 -4
@@ -939,11 +939,8 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr, post_read_steps |=1 <<STEP_VERITY ;if (post_read_steps) { +/* Due to the mempool, this never fails. */ ctx =mempool_alloc (bio_post_read_ctx_pool,GFP_NOFS ); -if (!ctx) { -bio_put (bio); -return ERR_PTR (-ENOMEM ); - } ctx->bio = bio; ctx->sbi = sbi; ctx->enabled_steps = post_read_steps;
Signature · 1 line
2.24.1
Quoted 7 lines · Eric Biggers
From: Eric Biggers <[email protected]>
Since allocating an object from a mempool never fails when
__GFP_DIRECT_RECLAIM(which is included inGFP_NOFS) is set, the check for failure to allocate abio_post_read_ctxis unnecessary. Remove it.Signed-off-by Eric Biggers <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,