Thread (37 messages) 37 messages, 12 authors, 2021-02-01
STALE1977d

[PATCH 16/17] nilfs2: remove cruft in nilfs_alloc_seg_bio

From: Christoph Hellwig <hch@lst.de>
Date: 2021-01-26 15:25:56
Also in: dm-devel, linux-bcache, linux-block, linux-btrfs, linux-f2fs-devel, linux-fsdevel, linux-mm, linux-nfs
Subsystem: filesystems (vfs and infrastructure), nilfs2 filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Ryusuke Konishi, Viacheslav Dubeyko, Linus Torvalds

bio_alloc never returns NULL when it can sleep.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/nilfs2/segbuf.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index 1a8729eded8b14..1e75417bfe6e52 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -386,10 +386,6 @@ static struct bio *nilfs_alloc_seg_bio(struct the_nilfs *nilfs, sector_t start,
 	struct bio *bio;
 
 	bio = bio_alloc(GFP_NOIO, nr_vecs);
-	if (bio == NULL) {
-		while (!bio && (nr_vecs >>= 1))
-			bio = bio_alloc(GFP_NOIO, nr_vecs);
-	}
 	if (likely(bio)) {
 		bio_set_dev(bio, nilfs->ns_bdev);
 		bio->bi_iter.bi_sector =
-- 
2.29.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help