Home
last modified time | relevance | path

Searched refs:bvec (Results 1 – 25 of 79) sorted by relevance

1234

/linux/include/linux/
H A Dbvec.h256 static inline void bvec_advance(const struct bio_vec *bvec, in bvec_advance() argument
265 bv->bv_page = bvec->bv_page + (bvec->bv_offset >> PAGE_SHIFT); in bvec_advance()
266 bv->bv_offset = bvec->bv_offset & ~PAGE_MASK; in bvec_advance()
269 bvec->bv_len - iter_all->done); in bvec_advance()
272 if (iter_all->done == bvec->bv_len) { in bvec_advance()
285 static inline void *bvec_kmap_local(struct bio_vec *bvec) in bvec_kmap_local() argument
287 return kmap_local_page(bvec->bv_page) + bvec->bv_offset; in bvec_kmap_local()
297 static inline void memcpy_from_bvec(char *to, struct bio_vec *bvec) in memcpy_from_bvec() argument
299 memcpy_from_page(to, bvec->bv_page, bvec->bv_offset, bvec->bv_len); in memcpy_from_bvec()
309 static inline void memcpy_to_bvec(struct bio_vec *bvec, const char *from) in memcpy_to_bvec() argument
[all …]
H A Dbio.h185 #define bio_iter_last(bvec, iter) ((iter).bi_size == (bvec).bv_len) argument
279 struct bio_vec *bvec = bio_first_bvec_all(bio) + i; in bio_first_folio() local
286 fi->folio = bvec_folio(bvec); in bio_first_folio()
287 fi->offset = bvec->bv_offset + in bio_first_folio()
288 PAGE_SIZE * folio_page_idx(fi->folio, bvec->bv_page); in bio_first_folio()
289 fi->_seg_count = bvec->bv_len; in bio_first_folio()
/linux/fs/erofs/
H A Dzdata.c26 struct z_erofs_bvec bvec[total]; \
160 unsigned long base = (unsigned long)((struct z_erofs_bvset *)0)->bvec; in z_erofs_bvset_flip()
192 struct z_erofs_bvec *bvec, in z_erofs_bvec_enqueue() argument
213 iter->bvset->bvec[iter->cur++] = *bvec; in z_erofs_bvec_enqueue()
218 struct z_erofs_bvec *bvec, in z_erofs_bvec_dequeue() argument
225 *bvec = iter->bvset->bvec[iter->cur++]; in z_erofs_bvec_dequeue()
630 struct z_erofs_bvec *bvec = pcl->compressed_bvecs; in z_erofs_cache_release_folio() local
631 struct z_erofs_bvec *end = bvec + z_erofs_pclusterpages(pcl); in z_erofs_cache_release_folio()
641 for (; bvec < end; ++bvec) { in z_erofs_cache_release_folio()
642 if (bvec->page && page_folio(bvec->page) == folio) { in z_erofs_cache_release_folio()
[all …]
/linux/block/
H A Dbio-integrity.c261 static int bio_integrity_copy_user(struct bio *bio, struct bio_vec *bvec, in bio_integrity_copy_user() argument
275 iov_iter_bvec(&iter, ITER_SOURCE, bvec, nr_vecs, len); in bio_integrity_copy_user()
298 bio_integrity_unpin_bvec(bvec, nr_vecs); in bio_integrity_copy_user()
300 memcpy(&bip->bip_vec[1], bvec, nr_vecs * sizeof(*bvec)); in bio_integrity_copy_user()
318 static int bio_integrity_init_user(struct bio *bio, struct bio_vec *bvec, in bio_integrity_init_user() argument
327 memcpy(bip->bip_vec, bvec, nr_vecs * sizeof(*bvec)); in bio_integrity_init_user()
333 static unsigned int bvec_from_pages(struct bio_vec *bvec, struct page **pages, in bvec_from_pages() argument
359 bvec_set_page(&bvec[nr_bvecs], pages[i], size, offset); in bvec_from_pages()
371 struct bio_vec stack_vec[UIO_FASTIOV], *bvec = stack_vec; in bio_integrity_map_user() local
387 bvec = kzalloc_objs(*bvec, nr_vecs); in bio_integrity_map_user()
[all …]
H A Dblk-map.c69 struct bio_vec *bvec; in bio_copy_from_iter() local
72 bio_for_each_segment_all(bvec, bio, iter_all) { in bio_copy_from_iter()
75 ret = copy_page_from_iter(bvec->bv_page, in bio_copy_from_iter()
76 bvec->bv_offset, in bio_copy_from_iter()
77 bvec->bv_len, in bio_copy_from_iter()
83 if (ret < bvec->bv_len) in bio_copy_from_iter()
100 struct bio_vec *bvec; in bio_copy_to_iter() local
103 bio_for_each_segment_all(bvec, bio, iter_all) { in bio_copy_to_iter()
106 ret = copy_page_to_iter(bvec->bv_page, in bio_copy_to_iter()
107 bvec->bv_offset, in bio_copy_to_iter()
[all …]
H A Dbio-integrity-fs.c11 struct bio_vec bvec; member
27 bio_integrity_init(bio, &iib->bip, &iib->bvec, 1); in fs_bio_integrity_alloc()
H A Dbio-integrity-auto.c21 struct bio_vec bvec; member
88 bio_integrity_init(bio, &bid->bip, &bid->bvec, 1); in bio_integrity_prep()
/linux/lib/
H A Diov_iter.c504 const struct bio_vec *bvec, *end; in iov_iter_bvec_advance() local
512 for (bvec = i->bvec, end = bvec + i->nr_segs; bvec < end; bvec++) { in iov_iter_bvec_advance()
513 if (likely(size < bvec->bv_len)) in iov_iter_bvec_advance()
515 size -= bvec->bv_len; in iov_iter_bvec_advance()
518 i->nr_segs -= bvec - i->bvec; in iov_iter_bvec_advance()
519 i->bvec = bvec; in iov_iter_bvec_advance()
640 const struct bio_vec *bvec = i->bvec; in iov_iter_revert() local
642 size_t n = (--bvec)->bv_len; in iov_iter_revert()
645 i->bvec = bvec; in iov_iter_revert()
679 return min(i->count, i->bvec->bv_len - i->iov_offset); in iov_iter_single_seg_count()
[all …]
/linux/drivers/nvme/target/
H A Dio-cmd-file.c94 iov_iter_bvec(&iter, rw, req->f.bvec, nr_segs, count); in nvmet_file_submit_bvec()
108 if (req->f.bvec != req->inline_bvec) { in nvmet_file_io_done()
110 kfree(req->f.bvec); in nvmet_file_io_done()
112 mempool_free(req->f.bvec, req->ns->bvec_pool); in nvmet_file_io_done()
142 bvec_set_page(&req->f.bvec[bv_cnt], sg_page(sg), sg->length, in nvmet_file_execute_io()
144 len += req->f.bvec[bv_cnt].bv_len; in nvmet_file_execute_io()
145 total_len += req->f.bvec[bv_cnt].bv_len; in nvmet_file_execute_io()
231 req->f.bvec = kmalloc_objs(struct bio_vec, nr_bvec); in nvmet_file_execute_rw()
233 req->f.bvec = req->inline_bvec; in nvmet_file_execute_rw()
235 if (unlikely(!req->f.bvec)) { in nvmet_file_execute_rw()
[all …]
/linux/fs/squashfs/
H A Dblock.c39 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in copy_bio_to_actor() local
50 int bytes_to_copy = min_t(int, bvec->bv_len - offset, in copy_bio_to_actor()
56 memcpy(actor_addr + actor_offset, bvec_virt(bvec) + in copy_bio_to_actor()
69 if (offset >= bvec->bv_len) { in copy_bio_to_actor()
313 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in squashfs_read_data() local
328 data = bvec_virt(bvec); in squashfs_read_data()
330 if (offset < bvec->bv_len - 1) { in squashfs_read_data()
337 data = bvec_virt(bvec); in squashfs_read_data()
H A Dlzo_wrapper.c70 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in lzo_uncompress() local
77 int avail = min(bytes, ((int)bvec->bv_len) - offset); in lzo_uncompress()
79 data = bvec_virt(bvec); in lzo_uncompress()
H A Dzlib_wrapper.c57 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in zlib_uncompress() local
83 avail = min(length, ((int)bvec->bv_len) - offset); in zlib_uncompress()
84 data = bvec_virt(bvec); in zlib_uncompress()
H A Dlz4_wrapper.c96 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in lz4_uncompress() local
102 int avail = min(bytes, ((int)bvec->bv_len) - offset); in lz4_uncompress()
104 data = bvec_virt(bvec); in lz4_uncompress()
H A Dzstd_wrapper.c72 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in zstd_uncompress() local
100 avail = min(length, ((int)bvec->bv_len) - offset); in zstd_uncompress()
101 data = bvec_virt(bvec); in zstd_uncompress()
H A Dxz_wrapper.c124 struct bio_vec *bvec = bvec_init_iter_all(&iter_all); in squashfs_xz_uncompress() local
152 avail = min(length, ((int)bvec->bv_len) - offset); in squashfs_xz_uncompress()
153 data = bvec_virt(bvec); in squashfs_xz_uncompress()
/linux/io_uring/
H A Drsrc.c155 struct folio *folio = bvec_folio(&imu->bvec[i]); in io_release_ubuf()
166 return kvmalloc_flex(struct io_mapped_ubuf, bvec, nr_bvecs); in io_alloc_imu()
188 struct page *page = imu->bvec[i].bv_page; in io_buffer_unaccount_pages()
244 const int imu_cache_size = struct_size_t(struct io_mapped_ubuf, bvec, in io_rsrc_cache_init()
931 bvec_set_page(&imu->bvec[i], pages[i], vec_len, off); in io_sqe_buffer_register()
1070 imu->bvec[nr_bvecs++] = bv; in io_buffer_register_bvec()
1134 iov_iter_bvec(iter, ddir, imu->bvec, imu->nr_bvecs, count); in io_import_kbuf()
1143 const struct bio_vec *bvec; in io_import_fixed() local
1175 bvec = imu->bvec; in io_import_fixed()
1176 if (offset >= bvec->bv_len) { in io_import_fixed()
[all …]
/linux/Documentation/block/
H A Dbiovecs.rst20 bytes completed in the current bvec.
43 As of 5.12 bvec segments with zero bv_len are not supported.
52 exactly one bvec at a time - for example, bio_copy_data() in block/bio.c,
60 coding bvec iterators before, and having common implementation considerably
65 it somewhere else if there was an error) had to save the entire bvec array
68 * Biovecs can be shared between multiple bios - a bvec iter can represent an
76 bios with more than a single bvec! Now, we can efficiently split arbitrary
88 fine to _most_ devices, but since accessing the raw bvec array was the
90 since all drivers _must_ go through the bvec iterator - and have been
145 * The following helpers iterate over multi-page bvec. The passed 'struct
/linux/fs/nfs/
H A Dlocalio.c37 struct bio_vec *bvec; member
309 kfree(iocb->bvec); in nfs_local_iocb_free()
323 iocb->bvec = kmalloc_objs(struct bio_vec, hdr->page_array.npages, flags); in nfs_local_iocb_alloc()
324 if (iocb->bvec == NULL) { in nfs_local_iocb_alloc()
386 const struct bio_vec *bvec = i->bvec; in nfs_iov_iter_aligned_bvec() local
393 size_t len = bvec->bv_len; in nfs_iov_iter_aligned_bvec()
397 if ((unsigned long)(bvec->bv_offset + skip) & addr_mask) in nfs_iov_iter_aligned_bvec()
399 bvec++; in nfs_iov_iter_aligned_bvec()
408 nfs_local_iter_setup(struct iov_iter *iter, int rw, struct bio_vec *bvec, in nfs_local_iter_setup() argument
412 iov_iter_bvec(iter, rw, bvec, nvecs, total); in nfs_local_iter_setup()
[all …]
/linux/drivers/target/
H A Dtarget_core_file.c318 struct bio_vec *bvec; in fd_do_rw() local
323 bvec = kzalloc_objs(struct bio_vec, sgl_nents); in fd_do_rw()
324 if (!bvec) { in fd_do_rw()
330 bvec_set_page(&bvec[i], sg_page(sg), sg->length, sg->offset); in fd_do_rw()
334 iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len); in fd_do_rw()
378 kfree(bvec); in fd_do_rw()
435 struct bio_vec *bvec; in fd_execute_write_same() local
458 bvec = kzalloc_objs(struct bio_vec, nolb); in fd_execute_write_same()
459 if (!bvec) in fd_execute_write_same()
463 bvec_set_page(&bvec[i], sg_page(&cmd->t_data_sg[0]), in fd_execute_write_same()
[all …]
/linux/fs/netfs/
H A Dbuffered_read.c404 struct bio_vec *bvec; in netfs_read_gaps() local
432 bvec = kmalloc_objs(*bvec, nr_bvec); in netfs_read_gaps()
433 if (!bvec) in netfs_read_gaps()
438 kfree(bvec); in netfs_read_gaps()
444 rreq->direct_bv = bvec; in netfs_read_gaps()
447 bvec_set_folio(&bvec[i++], folio, from, 0); in netfs_read_gaps()
452 bvec_set_folio(&bvec[i++], sink, part, 0); in netfs_read_gaps()
456 bvec_set_folio(&bvec[i++], folio, flen - to, to); in netfs_read_gaps()
457 iov_iter_bvec(&rreq->buffer.iter, ITER_DEST, bvec, i, rreq->len); in netfs_read_gaps()
/linux/lib/tests/
H A Dkunit_iov_iter.c239 struct bio_vec *bvec, unsigned int bvmax, in iov_kunit_load_bvec() argument
260 bvec[i].bv_len += pr->to; in iov_kunit_load_bvec()
262 bvec_set_page(&bvec[i], page, pr->to - pr->from, pr->from); in iov_kunit_load_bvec()
272 iov_iter_bvec(iter, dir, bvec, i, size); in iov_kunit_load_bvec()
282 struct bio_vec bvec[8]; in iov_kunit_copy_to_bvec() local
298 iov_kunit_load_bvec(test, &iter, READ, bvec, ARRAY_SIZE(bvec), in iov_kunit_copy_to_bvec()
335 struct bio_vec bvec[8]; in iov_kunit_copy_from_bvec() local
351 iov_kunit_load_bvec(test, &iter, WRITE, bvec, ARRAY_SIZE(bvec), in iov_kunit_copy_from_bvec()
800 struct bio_vec bvec[8]; in iov_kunit_extract_pages_bvec() local
809 iov_kunit_load_bvec(test, &iter, READ, bvec, ARRAY_SIZE(bvec), in iov_kunit_extract_pages_bvec()
[all …]
/linux/fs/btrfs/
H A Dmisc.h59 struct bio_vec *bvec; in bio_get_size() local
63 bio_for_each_bvec_all(bvec, bio, i) in bio_get_size()
64 ret += bvec->bv_len; in bio_get_size()
/linux/net/rds/
H A Dtcp_send.c76 struct bio_vec bvec; in rds_tcp_xmit() local
120 bvec_set_page(&bvec, sg_page(&rm->data.op_sg[sg]), in rds_tcp_xmit()
123 iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, in rds_tcp_xmit()
/linux/arch/xtensa/platforms/iss/
H A Dsimdisk.c107 struct bio_vec bvec; in simdisk_submit_bio() local
111 bio_for_each_segment(bvec, bio, iter) { in simdisk_submit_bio()
112 char *buffer = bvec_kmap_local(&bvec); in simdisk_submit_bio()
113 unsigned len = bvec.bv_len >> SECTOR_SHIFT; in simdisk_submit_bio()
/linux/drivers/nvdimm/
H A Dpmem.c206 struct bio_vec bvec; in pmem_submit_bio() local
224 bio_for_each_segment(bvec, bio, iter) { in pmem_submit_bio()
226 rc = pmem_do_write(pmem, bvec.bv_page, in pmem_submit_bio()
227 bvec.bv_offset, in pmem_submit_bio()
229 bvec.bv_len); in pmem_submit_bio()
231 rc = pmem_do_read(pmem, bvec.bv_page, in pmem_submit_bio()
232 bvec.bv_offset, in pmem_submit_bio()
234 bvec.bv_len); in pmem_submit_bio()

1234