Lines Matching refs:bio
33 static int copy_bio_to_actor(struct bio *bio, in copy_bio_to_actor() argument
46 if (WARN_ON_ONCE(!bio_next_segment(bio, &iter_all))) in copy_bio_to_actor()
70 if (!bio_next_segment(bio, &iter_all)) in copy_bio_to_actor()
79 static int squashfs_bio_read_cached(struct bio *fullbio, in squashfs_bio_read_cached()
87 struct bio *bio = NULL; in squashfs_bio_read_cached() local
114 if (!bio || idx != end_idx) { in squashfs_bio_read_cached()
115 struct bio *new = bio_alloc_clone(bdev, fullbio, in squashfs_bio_read_cached()
118 if (bio) { in squashfs_bio_read_cached()
119 bio_trim(bio, start_idx * PAGE_SECTORS, in squashfs_bio_read_cached()
121 bio_chain(bio, new); in squashfs_bio_read_cached()
122 submit_bio(bio); in squashfs_bio_read_cached()
125 bio = new; in squashfs_bio_read_cached()
133 if (bio) { in squashfs_bio_read_cached()
134 bio_trim(bio, start_idx * PAGE_SECTORS, in squashfs_bio_read_cached()
136 err = submit_bio_wait(bio); in squashfs_bio_read_cached()
137 bio_put(bio); in squashfs_bio_read_cached()
190 struct bio **biop, int *block_offset) in squashfs_bio_read()
202 struct bio *bio; in squashfs_bio_read() local
204 bio = bio_kmalloc(page_count, GFP_NOIO); in squashfs_bio_read()
205 if (!bio) in squashfs_bio_read()
207 bio_init(bio, sb->s_bdev, bio->bi_inline_vecs, page_count, REQ_OP_READ); in squashfs_bio_read()
208 bio->bi_iter.bi_sector = block * (msblk->devblksize >> SECTOR_SHIFT); in squashfs_bio_read()
229 __bio_add_page(bio, page, len, offset); in squashfs_bio_read()
235 error = squashfs_bio_read_cached(bio, cache_mapping, index, in squashfs_bio_read()
239 error = submit_bio_wait(bio); in squashfs_bio_read()
243 *biop = bio; in squashfs_bio_read()
248 bio_free_pages(bio); in squashfs_bio_read()
249 bio_uninit(bio); in squashfs_bio_read()
250 kfree(bio); in squashfs_bio_read()
267 struct bio *bio = NULL; in squashfs_read_data() local
292 res = squashfs_bio_read(sb, index, 2, &bio, &offset); in squashfs_read_data()
296 if (WARN_ON_ONCE(!bio_next_segment(bio, &iter_all))) { in squashfs_read_data()
306 if (WARN_ON_ONCE(!bio_next_segment(bio, &iter_all))) { in squashfs_read_data()
313 bio_free_pages(bio); in squashfs_read_data()
314 bio_uninit(bio); in squashfs_read_data()
315 kfree(bio); in squashfs_read_data()
333 res = squashfs_bio_read(sb, index, length, &bio, &offset); in squashfs_read_data()
342 res = msblk->thread_ops->decompress(msblk, bio, offset, length, output); in squashfs_read_data()
344 res = copy_bio_to_actor(bio, output, offset, length); in squashfs_read_data()
348 bio_free_pages(bio); in squashfs_read_data()
349 bio_uninit(bio); in squashfs_read_data()
350 kfree(bio); in squashfs_read_data()