]> www.infradead.org Git - users/hch/misc.git/commitdiff
bcache: use bio_add_virt_nofail
authorChristoph Hellwig <hch@lst.de>
Fri, 21 Mar 2025 12:45:08 +0000 (13:45 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 29 Apr 2025 19:03:19 +0000 (14:03 -0500)
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the
bio_add_virt_nofail helper implementing it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Coly Li <colyli@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
drivers/md/bcache/super.c

index 813b38aec3e4e07c54ed8ef717f9f381f8c9b29b..c40db9c161c1a1e4f55a3e7579b0e4aaa708c9d8 100644 (file)
@@ -293,8 +293,7 @@ static void __write_super(struct cache_sb *sb, struct cache_sb_disk *out,
 
        bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_META;
        bio->bi_iter.bi_sector  = SB_SECTOR;
-       __bio_add_page(bio, virt_to_page(out), SB_SIZE,
-                       offset_in_page(out));
+       bio_add_virt_nofail(bio, out, SB_SIZE);
 
        out->offset             = cpu_to_le64(sb->offset);