| /linux/include/linux/ |
| H A D | bvec.h | 98 #define __bvec_iter_bvec(bvec, iter) (&(bvec)[(iter).bi_idx]) argument 101 #define mp_bvec_iter_page(bvec, iter) \ argument 102 (__bvec_iter_bvec((bvec), (iter))->bv_page) 104 #define mp_bvec_iter_len(bvec, iter) \ argument 106 __bvec_iter_bvec((bvec), (iter))->bv_len - (iter).bi_bvec_done) 108 #define mp_bvec_iter_offset(bvec, iter) \ argument 109 (__bvec_iter_bvec((bvec), (iter))->bv_offset + (iter).bi_bvec_done) 111 #define mp_bvec_iter_page_idx(bvec, iter) \ argument 112 (mp_bvec_iter_offset((bvec), (iter)) / PAGE_SIZE) 114 #define mp_bvec_iter_bvec(bvec, iter) \ argument [all …]
|
| H A D | iov_iter.h | 112 const struct bio_vec *p = iter->bvec; in iterate_bvec() 137 iter->nr_segs -= p - iter->bvec; in iterate_bvec() 138 iter->bvec = p; in iterate_bvec()
|
| /linux/block/ |
| H A D | blk-map.c | 69 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 …]
|
| /linux/io_uring/ |
| H A D | rsrc.c | 119 struct folio *folio = page_folio(imu->bvec[i].bv_page); in io_release_ubuf() 130 return kvmalloc(struct_size_t(struct io_mapped_ubuf, bvec, nr_bvecs), in io_alloc_imu() 171 const int imu_cache_size = struct_size_t(struct io_mapped_ubuf, bvec, in io_rsrc_cache_init() 653 if (!PageCompound(imu->bvec[j].bv_page)) in headpage_already_acct() 655 if (compound_head(imu->bvec[j].bv_page) == hpage) in headpage_already_acct() 809 /* If it's huge page(s), try to coalesce them into fewer bvec entries */ in io_sqe_buffer_register() 848 bvec_set_page(&imu->bvec[i], pages[i], vec_len, off); in io_sqe_buffer_register() 992 imu->bvec[nr_bvecs++] = bv; in io_buffer_register_bvec() 1056 iov_iter_bvec(iter, ddir, imu->bvec, imu->nr_bvecs, count); in io_import_kbuf() 1060 const struct bio_vec *bvec in io_import_kbuf() local 1075 const struct bio_vec *bvec; io_import_fixed() local 1446 const struct bio_vec *bvec = imu->bvec; iov_kern_bvec_size() local [all...] |
| /linux/drivers/nvme/target/ |
| H A D | io-cmd-file.c | 94 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_array(nr_bvec, sizeof(struct bio_vec), in nvmet_file_execute_rw() 234 req->f.bvec = req->inline_bvec; in nvmet_file_execute_rw() 236 if (unlikely(!req->f.bvec)) { in nvmet_file_execute_rw() [all …]
|
| H A D | tcp.c | 617 struct bio_vec bvec; in nvmet_try_send_data_pdu() local 622 bvec_set_virt(&bvec, (void *)cmd->data_pdu + cmd->offset, left); in nvmet_try_send_data_pdu() 623 iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, left); in nvmet_try_send_data_pdu() 649 struct bio_vec bvec; in nvmet_try_send_data() local 657 bvec_set_page(&bvec, page, left, cmd->offset); in nvmet_try_send_data() 658 iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, left); in nvmet_try_send_data() 696 struct bio_vec bvec; in nvmet_try_send_response() local 706 bvec_set_virt(&bvec, (void *)cmd->rsp_pdu + cmd->offset, left); in nvmet_try_send_response() 707 iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, left); in nvmet_try_send_response() 726 struct bio_vec bvec; in nvmet_try_send_r2t() local [all …]
|
| /linux/mm/ |
| H A D | page_io.c | 325 struct bio_vec bvec[SWAP_CLUSTER_MAX]; member 347 struct page *page = sio->bvec[0].bv_page; in sio_write_complete() 362 page = sio->bvec[p].bv_page; in sio_write_complete() 369 end_page_writeback(sio->bvec[p].bv_page); in sio_write_complete() 399 bvec_set_folio(&sio->bvec[sio->pages], folio, folio_size(folio), 0); in swap_writepage_fs() 402 if (sio->pages == ARRAY_SIZE(sio->bvec) || !swap_plug) { in swap_writepage_fs() 476 iov_iter_bvec(&from, ITER_SOURCE, sio->bvec, sio->pages, sio->len); in swap_write_unplug() 489 struct folio *folio = page_folio(sio->bvec[p].bv_page); in sio_read_complete() 499 struct folio *folio = page_folio(sio->bvec[p].bv_page); in sio_read_complete() 561 bvec_set_folio(&sio->bvec[sio->pages], folio, folio_size(folio), 0); in swap_read_folio_fs() [all …]
|
| /linux/drivers/block/ |
| H A D | n64cart.c | 89 struct bio_vec bvec; in n64cart_submit_bio() local 94 bio_for_each_segment(bvec, bio, iter) { in n64cart_submit_bio() 95 if (!n64cart_do_bvec(dev, &bvec, pos)) { in n64cart_submit_bio() 99 pos += bvec.bv_len; in n64cart_submit_bio()
|
| /linux/fs/nfs/ |
| H A D | localio.c | 37 struct bio_vec *bvec; member 292 kfree(iocb->bvec); in nfs_local_iocb_free() 306 iocb->bvec = kmalloc_array(hdr->page_array.npages, in nfs_local_iocb_alloc() 308 if (iocb->bvec == NULL) { in nfs_local_iocb_alloc() 369 const struct bio_vec *bvec = i->bvec; in nfs_iov_iter_aligned_bvec() local 376 size_t len = bvec->bv_len; in nfs_iov_iter_aligned_bvec() 380 if ((unsigned long)(bvec->bv_offset + skip) & addr_mask) in nfs_iov_iter_aligned_bvec() 382 bvec++; in nfs_iov_iter_aligned_bvec() 391 nfs_local_iter_setup(struct iov_iter *iter, int rw, struct bio_vec *bvec, in nfs_local_iter_setup() argument 395 iov_iter_bvec(iter, rw, bvec, nvecs, total); in nfs_local_iter_setup() [all …]
|
| /linux/Documentation/block/ |
| H A D | biovecs.rst | 20 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 146 * The following helpers iterate over multi-page bvec. The passed 'struct
|
| /linux/drivers/target/ |
| H A D | target_core_file.c | 318 struct bio_vec *bvec; in fd_do_rw() local 323 bvec = kcalloc(sgl_nents, sizeof(struct bio_vec), GFP_KERNEL); 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 = kcalloc(nolb, sizeof(struct bio_vec), GFP_KERNEL); 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/squashfs/ |
| H A D | lzo_wrapper.c | 70 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 D | zlib_wrapper.c | 57 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 D | lz4_wrapper.c | 96 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 D | zstd_wrapper.c | 72 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 D | xz_wrapper.c | 124 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/fs/netfs/ |
| H A D | buffered_read.c | 404 struct bio_vec *bvec; in netfs_read_gaps() local 432 bvec = kmalloc_array(nr_bvec, sizeof(*bvec), GFP_KERNEL); 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/net/rds/ |
| H A D | tcp_send.c | 76 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/fs/iomap/ |
| H A D | bio.c | 81 struct bio_vec bvec; in iomap_bio_read_folio_range_sync() local 84 bio_init(&bio, srcmap->bdev, &bvec, 1, REQ_OP_READ); in iomap_bio_read_folio_range_sync()
|
| /linux/arch/xtensa/platforms/iss/ |
| H A D | simdisk.c | 107 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/fs/btrfs/ |
| H A D | compression.c | 1185 static u64 file_offset_from_bvec(const struct bio_vec *bvec) in file_offset_from_bvec() argument 1187 const struct page *page = bvec->bv_page; in file_offset_from_bvec() 1190 return (page_pgoff(folio, page) << PAGE_SHIFT) + bvec->bv_offset; in file_offset_from_bvec() 1233 struct bio_vec bvec; in btrfs_decompress_buf2page() local 1240 bvec = bio_iter_iovec(orig_bio, orig_bio->bi_iter); in btrfs_decompress_buf2page() 1245 bvec_offset = file_offset_from_bvec(&bvec) - cb->start; in btrfs_decompress_buf2page() 1252 copy_len = min(bvec_offset + bvec.bv_len, in btrfs_decompress_buf2page() 1262 kaddr = bvec_kmap_local(&bvec); in btrfs_decompress_buf2page()
|
| /linux/drivers/block/zram/ |
| H A D | zram_drv.c | 195 static inline bool is_partial_io(struct bio_vec *bvec) in is_partial_io() argument 197 return bvec->bv_len != PAGE_SIZE; in is_partial_io() 201 static inline bool is_partial_io(struct bio_vec *bvec) in is_partial_io() argument 2029 static int zram_bvec_read_partial(struct zram *zram, struct bio_vec *bvec, in zram_bvec_read_partial() argument 2039 memcpy_to_bvec(bvec, page_address(page) + offset); in zram_bvec_read_partial() 2044 static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, in zram_bvec_read() argument 2047 if (is_partial_io(bvec)) in zram_bvec_read() 2048 return zram_bvec_read_partial(zram, bvec, index, offset); in zram_bvec_read() 2049 return zram_read_page(zram, bvec->bv_page, index, bio); in zram_bvec_read() 2174 static int zram_bvec_write_partial(struct zram *zram, struct bio_vec *bvec, in zram_bvec_write_partial() argument [all …]
|
| /linux/net/sunrpc/ |
| H A D | svcsock.c | 316 static void svc_flush_bvec(const struct bio_vec *bvec, size_t size, size_t seek) in svc_flush_bvec() argument 323 bvec_iter_advance(bvec, &bi, seek & PAGE_MASK); in svc_flush_bvec() 324 for_each_bvec(bv, bvec, bi, bi) in svc_flush_bvec() 328 static inline void svc_flush_bvec(const struct bio_vec *bvec, size_t size, in svc_flush_bvec() argument 344 struct bio_vec *bvec = rqstp->rq_bvec; in svc_tcp_read_msg() local 353 bvec_set_page(&bvec[i], rqstp->rq_pages[i], PAGE_SIZE, 0); in svc_tcp_read_msg() 357 iov_iter_bvec(&msg.msg_iter, ITER_DEST, bvec, i, buflen); in svc_tcp_read_msg() 364 svc_flush_bvec(bvec, len, seek); in svc_tcp_read_msg()
|
| H A D | xdr.c | 120 if (n != 0 && buf->bvec == NULL) { in xdr_alloc_bvec() 121 buf->bvec = kmalloc_array(n, sizeof(buf->bvec[0]), gfp); in xdr_alloc_bvec() 122 if (!buf->bvec) in xdr_alloc_bvec() 125 bvec_set_page(&buf->bvec[i], buf->pages[i], PAGE_SIZE, in xdr_alloc_bvec() 135 kfree(buf->bvec); in xdr_free_bvec() 136 buf->bvec = NULL; in xdr_free_bvec() 147 unsigned int xdr_buf_to_bvec(struct bio_vec *bvec, unsigned int bvec_size, in xdr_buf_to_bvec() argument 155 bvec_set_virt(bvec++, head->iov_base, head->iov_len); in xdr_buf_to_bvec() 168 bvec_set_page(bvec++, *pages++, len, offset); in xdr_buf_to_bvec() 177 bvec_set_virt(bvec, tail->iov_base, tail->iov_len); in xdr_buf_to_bvec()
|
| /linux/Documentation/admin-guide/device-mapper/ |
| H A D | dm-io.rst | 42 int rw, struct bio_vec *bvec, 45 int rw, struct bio_vec *bvec,
|