search for: bio_alloc

Displaying 20 results from an estimated 75 matches for "bio_alloc".

2013 Jun 21
5
[PATCH 3/4] xen-blkback: check the number of iovecs before allocating a bios
...lock/xen-blkback/blkback.c index d622d86..876116b 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -1236,7 +1236,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, seg[i].nsec << 9, seg[i].offset) == 0)) { - bio = bio_alloc(GFP_KERNEL, nseg-i); + int nr_iovecs = (nseg-i) > BIO_MAX_PAGES ? BIO_MAX_PAGES : (nseg-i); + bio = bio_alloc(GFP_KERNEL, nr_iovecs); if (unlikely(bio == NULL)) goto fail_put_bio; -- 1.7.7.5 (Apple Git-26) _______________________________________________ Xen-devel mailing list X...
2023 Aug 06
0
[PATCH v4] virtio_pmem: add the missing REQ_OP_WRITE for flush bio
...nt async_pmem_flush(struct nd_region *nd_region, struct bio *bio) > > > ???????? * parent bio. Otherwise directly call nd_region flush. > > > ???????? */ > > > ??????? if (bio && bio->bi_iter.bi_sector != -1) { > > > -?????????????? struct bio *child = bio_alloc(bio->bi_bdev, 0, REQ_PREFLUSH, > > > +?????????????? struct bio *child = bio_alloc(bio->bi_bdev, 0, > > > +???????????????????????????????????????????? REQ_OP_WRITE | REQ_PREFLUSH, > > > ????????????????????????????????????????????? GFP_ATOMIC); > > > >...
2023 Aug 06
0
[PATCH v4] virtio_pmem: add the missing REQ_OP_WRITE for flush bio
...nt async_pmem_flush(struct nd_region *nd_region, struct bio *bio) > > > ???????? * parent bio. Otherwise directly call nd_region flush. > > > ???????? */ > > > ??????? if (bio && bio->bi_iter.bi_sector != -1) { > > > -?????????????? struct bio *child = bio_alloc(bio->bi_bdev, 0, REQ_PREFLUSH, > > > +?????????????? struct bio *child = bio_alloc(bio->bi_bdev, 0, > > > +???????????????????????????????????????????? REQ_OP_WRITE | REQ_PREFLUSH, > > > ????????????????????????????????????????????? GFP_ATOMIC); > > > >...
2019 Apr 11
4
[PATCH v5 1/6] libnvdimm: nd_region flush callback support
...int rc = 0; > + > + /* Create child bio for asynchronous flush and chain with > + * parent bio. Otherwise directly call nd_region flush. > + */ > + if (async && bio->bi_iter.bi_sector != -1) { > + > + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > + > + if (!child) > + return -ENOMEM; > + bio_copy_dev(child, bio); > + child->bi_opf = REQ_PREFLUSH; > + child->bi_iter.bi_sector = -1; > + bio_chain(child, bio)...
2019 Apr 11
4
[PATCH v5 1/6] libnvdimm: nd_region flush callback support
...int rc = 0; > + > + /* Create child bio for asynchronous flush and chain with > + * parent bio. Otherwise directly call nd_region flush. > + */ > + if (async && bio->bi_iter.bi_sector != -1) { > + > + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > + > + if (!child) > + return -ENOMEM; > + bio_copy_dev(child, bio); > + child->bi_opf = REQ_PREFLUSH; > + child->bi_iter.bi_sector = -1; > + bio_chain(child, bio)...
2012 May 03
1
[PATCH] Btrfs: fix crash in scrub repair code when device is missing
..._recheck_block(struct btrfs_fs_info *fs_info, struct scrub_page *page = sblock->pagev + page_num; DECLARE_COMPLETION_ONSTACK(complete); + if (page->bdev == NULL) { + page->io_error = 1; + sblock->no_io_error_seen = 0; + continue; + } + BUG_ON(!page->page); bio = bio_alloc(GFP_NOFS, 1); if (!bio) -- 1.7.10.1.362.g242cab3 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2019 Apr 11
1
[Qemu-devel] [PATCH v5 1/6] libnvdimm: nd_region flush callback support
...hild bio for asynchronous flush and chain with > > > + * parent bio. Otherwise directly call nd_region flush. > > > + */ > > > + if (async && bio->bi_iter.bi_sector != -1) { > > > + > > > + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > > > + > > > + if (!child) > > > + return -ENOMEM; > > > + bio_copy_dev(child, bio); > > > + child->bi_opf = REQ_PREFLUSH; > > > + child->bi_ite...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...t; + int rc = 0; >>> + >>> + /* Create child bio for asynchronous flush and chain with >>> + * parent bio. Otherwise directly call nd_region flush. >>> + */ >>> + if (bio && bio->bi_iter.bi_sector != -1) { >>> + struct bio *child = bio_alloc(GFP_ATOMIC, 0); >>> + >>> + if (!child) >>> + return -ENOMEM; >>> + bio_copy_dev(child, bio); >>> + child->bi_opf = REQ_PREFLUSH; >>> + child->bi_iter.bi_sector = -1; >>> + bio_chain(child, bio); >>> + submit_bio(...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...t; + int rc = 0; >>> + >>> + /* Create child bio for asynchronous flush and chain with >>> + * parent bio. Otherwise directly call nd_region flush. >>> + */ >>> + if (bio && bio->bi_iter.bi_sector != -1) { >>> + struct bio *child = bio_alloc(GFP_ATOMIC, 0); >>> + >>> + if (!child) >>> + return -ENOMEM; >>> + bio_copy_dev(child, bio); >>> + child->bi_opf = REQ_PREFLUSH; >>> + child->bi_iter.bi_sector = -1; >>> + bio_chain(child, bio); >>> + submit_bio(...
2005 Nov 01
2
xen, lvm, drbd, bad kernel messages
...1 13:52:13 localhost kernel: [mempool_alloc+115/432] mempool_alloc+0x73/0x1b0 Nov 1 13:52:13 localhost kernel: [autoremove_wake_function+0/96] autoremove_wake_function+0x0/0x60 Nov 1 13:52:13 localhost kernel: [submit_bio+98/256] submit_bio +0x62/0x100 Nov 1 13:52:13 localhost kernel: [bio_alloc+231/480] bio_alloc +0xe7/0x1e0 Nov 1 13:52:13 localhost kernel: [end_buffer_async_read+0/320] end_buffer_async_read+0x0/0x140 Nov 1 13:52:13 localhost kernel: [submit_bh+213/288] submit_bh +0xd5/0x120 Nov 1 13:52:13 localhost kernel: [block_read_full_page+404/672] block_read_full_page+0...
2019 Apr 11
0
[Qemu-devel] [PATCH v5 1/6] libnvdimm: nd_region flush callback support
...> + /* Create child bio for asynchronous flush and chain with > > + * parent bio. Otherwise directly call nd_region flush. > > + */ > > + if (async && bio->bi_iter.bi_sector != -1) { > > + > > + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > > + > > + if (!child) > > + return -ENOMEM; > > + bio_copy_dev(child, bio); > > + child->bi_opf = REQ_PREFLUSH; > > + child->bi_iter.bi_sector = -1; > > +...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...d_region *nd_region, struct bio *bio) > +{ > + int rc = 0; > + > + /* Create child bio for asynchronous flush and chain with > + * parent bio. Otherwise directly call nd_region flush. > + */ > + if (bio && bio->bi_iter.bi_sector != -1) { > + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > + > + if (!child) > + return -ENOMEM; > + bio_copy_dev(child, bio); > + child->bi_opf = REQ_PREFLUSH; > + child->bi_iter.bi_sector = -1; > + bio_chain(child, bio); > + submit_bio(child); return 0; Then, drop the "else" case and &qu...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...d_region *nd_region, struct bio *bio) > +{ > + int rc = 0; > + > + /* Create child bio for asynchronous flush and chain with > + * parent bio. Otherwise directly call nd_region flush. > + */ > + if (bio && bio->bi_iter.bi_sector != -1) { > + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > + > + if (!child) > + return -ENOMEM; > + bio_copy_dev(child, bio); > + child->bi_opf = REQ_PREFLUSH; > + child->bi_iter.bi_sector = -1; > + bio_chain(child, bio); > + submit_bio(child); return 0; Then, drop the "else" case and &qu...
2019 May 14
0
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...> + > >>> + /* Create child bio for asynchronous flush and chain with > >>> + * parent bio. Otherwise directly call nd_region flush. > >>> + */ > >>> + if (bio && bio->bi_iter.bi_sector != -1) { > >>> + struct bio *child = bio_alloc(GFP_ATOMIC, 0); > >>> + > >>> + if (!child) > >>> + return -ENOMEM; > >>> + bio_copy_dev(child, bio); > >>> + child->bi_opf = REQ_PREFLUSH; > >>> + child->bi_iter.bi_sector = -1; > >>> + bio_chain(child...
2012 Nov 19
1
[PATCH] vhost-blk: Add vhost-blk support v5
...uct bio *bio = NULL; + int bio_nr = 0; + void *buf; + + pages_nr_total = 0; + for (i = 0; i < iov_nr; i++) + pages_nr_total += iov_num_pages(&iov[i]); + + if (unlikely(req->write == WRITE_FLUSH)) { + req->pl = NULL; + req->bio = kmalloc(sizeof(struct bio *), GFP_KERNEL); + bio = bio_alloc(GFP_KERNEL, 1); + if (!bio) { + kfree(req->bio); + return -ENOMEM; + } + bio->bi_sector = req->sector; + bio->bi_bdev = bdev; + bio->bi_private = req; + bio->bi_end_io = vhost_blk_req_done; + req->bio[bio_nr++] = bio; + + goto out; + } + + pl_len = iov_nr * siz...
2012 Nov 19
1
[PATCH] vhost-blk: Add vhost-blk support v5
...uct bio *bio = NULL; + int bio_nr = 0; + void *buf; + + pages_nr_total = 0; + for (i = 0; i < iov_nr; i++) + pages_nr_total += iov_num_pages(&iov[i]); + + if (unlikely(req->write == WRITE_FLUSH)) { + req->pl = NULL; + req->bio = kmalloc(sizeof(struct bio *), GFP_KERNEL); + bio = bio_alloc(GFP_KERNEL, 1); + if (!bio) { + kfree(req->bio); + return -ENOMEM; + } + bio->bi_sector = req->sector; + bio->bi_bdev = bdev; + bio->bi_private = req; + bio->bi_end_io = vhost_blk_req_done; + req->bio[bio_nr++] = bio; + + goto out; + } + + pl_len = iov_nr * siz...
2012 Oct 15
2
[PATCH 1/1] vhost-blk: Add vhost-blk support v4
...->len = 0; + pages_nr_total = 0; + for (i = 0; i < iov_nr; i++) { + req->len += iov[i].iov_len; + pages_nr_total += iov_num_pages(&iov[i]); + } + + if (unlikely(req->write == WRITE_FLUSH)) { + req->pl = NULL; + req->bio = kmalloc(sizeof(struct bio *), GFP_KERNEL); + bio = bio_alloc(GFP_KERNEL, 1); + if (!bio) { + kfree(req->bio); + return -ENOMEM; + } + bio->bi_sector = req->sector; + bio->bi_bdev = bdev; + bio->bi_private = req; + bio->bi_end_io = vhost_blk_req_done; + req->bio[bio_nr++] = bio; + + goto out; + } + + req->pl = kmalloc(...
2012 Oct 15
2
[PATCH 1/1] vhost-blk: Add vhost-blk support v4
...->len = 0; + pages_nr_total = 0; + for (i = 0; i < iov_nr; i++) { + req->len += iov[i].iov_len; + pages_nr_total += iov_num_pages(&iov[i]); + } + + if (unlikely(req->write == WRITE_FLUSH)) { + req->pl = NULL; + req->bio = kmalloc(sizeof(struct bio *), GFP_KERNEL); + bio = bio_alloc(GFP_KERNEL, 1); + if (!bio) { + kfree(req->bio); + return -ENOMEM; + } + bio->bi_sector = req->sector; + bio->bi_bdev = bdev; + bio->bi_private = req; + bio->bi_end_io = vhost_blk_req_done; + req->bio[bio_nr++] = bio; + + goto out; + } + + req->pl = kmalloc(...
2012 Oct 10
0
[PATCH] vhost-blk: Add vhost-blk support v3
...->len = 0; + pages_nr_total = 0; + for (i = 0; i < iov_nr; i++) { + req->len += iov[i].iov_len; + pages_nr_total += iov_num_pages(&iov[i]); + } + + if (unlikely(req->write == WRITE_FLUSH)) { + req->pl = NULL; + req->bio = kmalloc(sizeof(struct bio *), GFP_KERNEL); + bio = bio_alloc(GFP_KERNEL, 1); + if (!bio) { + kfree(req->bio); + return -ENOMEM; + } + bio->bi_sector = req->sector; + bio->bi_bdev = bdev; + bio->bi_private = req; + bio->bi_end_io = vhost_blk_req_done; + req->bio[bio_nr++] = bio; + + goto out; + } + + req->pl = kmalloc(...
2012 Oct 10
0
[PATCH] vhost-blk: Add vhost-blk support v3
...->len = 0; + pages_nr_total = 0; + for (i = 0; i < iov_nr; i++) { + req->len += iov[i].iov_len; + pages_nr_total += iov_num_pages(&iov[i]); + } + + if (unlikely(req->write == WRITE_FLUSH)) { + req->pl = NULL; + req->bio = kmalloc(sizeof(struct bio *), GFP_KERNEL); + bio = bio_alloc(GFP_KERNEL, 1); + if (!bio) { + kfree(req->bio); + return -ENOMEM; + } + bio->bi_sector = req->sector; + bio->bi_bdev = bdev; + bio->bi_private = req; + bio->bi_end_io = vhost_blk_req_done; + req->bio[bio_nr++] = bio; + + goto out; + } + + req->pl = kmalloc(...