Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c212991a authored by Namjae Jeon's avatar Namjae Jeon Committed by Jaegeuk Kim
Browse files

f2fs: rewrite f2fs_bio_alloc to make it simpler



Since, GFP_NOFS(__GFP_WAIT) is used for allocation requests of bio in f2fs.
So, there is no chance of returning NULL from the BIO allocation.

Making the bio allocation routine for f2fs simpler.

Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarAmit Sahrawat <a.sahrawat@samsung.com>
parent d08ab08d
Loading
Loading
Loading
Loading
+7 −17
Original line number Diff line number Diff line
@@ -647,15 +647,10 @@ struct bio *f2fs_bio_alloc(struct block_device *bdev, sector_t first_sector,
					int nr_vecs, gfp_t gfp_flags)
{
	struct bio *bio;
repeat:

	/* allocate new bio */
	bio = bio_alloc(gfp_flags, nr_vecs);

	if (bio == NULL && (current->flags & PF_MEMALLOC)) {
		while (!bio && (nr_vecs /= 2))
			bio = bio_alloc(gfp_flags, nr_vecs);
	}
	if (bio) {
	bio->bi_bdev = bdev;
	bio->bi_sector = first_sector;
retry:
@@ -665,11 +660,6 @@ retry:
		cond_resched();
		goto retry;
	}
	}
	if (bio == NULL) {
		cond_resched();
		goto repeat;
	}
	return bio;
}