search for: bio_chain

Displaying 20 results from an estimated 39 matches for "bio_chain".

2019 Apr 11
1
[Qemu-devel] [PATCH v5 1/6] libnvdimm: nd_region flush callback support
...t; failure to userspace. > > > > > > This also handles asynchronous flush requests from the block layer > > > by creating a child bio and chaining it with parent bio. > > > > > > Signed-off-by: Pankaj Gupta <pagupta at redhat.com> > > > ---bio_chain Dan williams > > [..] > > > diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c > > > index b4ef7d9ff22e..fb1041ab32a6 100644 > > > --- a/drivers/nvdimm/region_devs.c > > > +++ b/drivers/nvdimm/region_devs.c > > > @@ -295,7 +29...
2019 Apr 11
4
[PATCH v5 1/6] libnvdimm: nd_region flush callback support
...io *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); I understand how this works, but it's a bit too "magical" for my taste. I would prefer that all flush implementations take an optional 'bio' argument rather than rely on the make_request implementation to stash the bio away...
2019 Apr 11
4
[PATCH v5 1/6] libnvdimm: nd_region flush callback support
...io *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); I understand how this works, but it's a bit too "magical" for my taste. I would prefer that all flush implementations take an optional 'bio' argument rather than rely on the make_request implementation to stash the bio away...
2019 Apr 11
0
[Qemu-devel] [PATCH v5 1/6] libnvdimm: nd_region flush callback support
...returned by host fsync > > failure to userspace. > > > > This also handles asynchronous flush requests from the block layer > > by creating a child bio and chaining it with parent bio. > > > > Signed-off-by: Pankaj Gupta <pagupta at redhat.com> > > ---bio_chain Dan williams > [..] > > diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c > > index b4ef7d9ff22e..fb1041ab32a6 100644 > > --- a/drivers/nvdimm/region_devs.c > > +++ b/drivers/nvdimm/region_devs.c > > @@ -295,7 +295,9 @@ static ssize_t deep_flu...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...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 "int rc" and do directly >> >> if (virtio_pmem_flush(nd_region)) >> return -EIO; > > and another 'return 0' here :) >...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...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 "int rc" and do directly >> >> if (virtio_pmem_flush(nd_region)) >> return -EIO; > > and another 'return 0' here :) >...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...; + */ > + 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 "int rc" and do directly if (virtio_pmem_flush(nd_region)) return -EIO; > + } else { > + > + rc = -EIO; > + } > + > + return rc; > +}; > +EXPORT_SYMBOL_GPL(async_pme...
2019 May 14
2
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...; + */ > + 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 "int rc" and do directly if (virtio_pmem_flush(nd_region)) return -EIO; > + } else { > + > + rc = -EIO; > + } > + > + return rc; > +}; > +EXPORT_SYMBOL_GPL(async_pme...
2019 May 14
0
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...ild = 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 "int rc" and do directly > >> > >> if (virtio_pmem_flush(nd_region)) > >> return -EIO; > > &gt...
2019 May 07
2
[PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
...io *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); > + } else { > + if (virtio_pmem_flush(nd_region)) > + rc = -EIO; > + } > + > + return rc; > +}; > +EXPORT_SYMBOL_GPL(async_pmem_flush); > +MODULE_LICENSE("GPL&...
2019 May 07
2
[PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
...io *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); > + } else { > + if (virtio_pmem_flush(nd_region)) > + rc = -EIO; > + } > + > + return rc; > +}; > +EXPORT_SYMBOL_GPL(async_pmem_flush); > +MODULE_LICENSE("GPL&...
2019 May 10
1
[Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
...+ 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); > > > + } else { > > > + if (virtio_pmem_flush(nd_region)) > > > + rc = -EIO; > > > + } > > > + > > > + return rc; > > &gt...
2019 Jun 11
2
[PATCH v12 2/7] virtio-pmem: Add virtio pmem driver
...line. > + 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; > + } > + if (virtio_pmem_flush(nd_region)) > + return -EIO; > + > + return 0; > +}; > +EXPORT_SYMBOL_GPL(async_pmem_flush); > +MODULE_LICENSE("GPL"); (...) I have only some more minor comments; on the wh...
2019 Jun 11
2
[PATCH v12 2/7] virtio-pmem: Add virtio pmem driver
...line. > + 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; > + } > + if (virtio_pmem_flush(nd_region)) > + return -EIO; > + > + return 0; > +}; > +EXPORT_SYMBOL_GPL(async_pmem_flush); > +MODULE_LICENSE("GPL"); (...) I have only some more minor comments; on the wh...
2019 Apr 30
1
[Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
...; + */ > + 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); > + } else { > + if (virtio_pmem_flush(nd_region)) > + rc = -EIO; > + } > + > + return rc; > +}; > +EXPORT_SYMBOL_GPL(async_pmem_flush); > +MODULE_LICENSE("GPL"); > diff --git a/drivers/virtio/Kconfig b/drivers/virti...
2019 Apr 10
0
[PATCH v5 1/6] libnvdimm: nd_region flush callback support
.... 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); + submit_bio(child); + } else { + if (nd_region->flush(nd_region)) + rc = -EIO; + } + + return rc; +} /** * nvdimm_flush - flush any posted write queues between the cpu and pmem media * @nd_region: blk or interleaved pmem region */ -void nvdimm_flush(struct nd_region *nd_...
2019 May 12
1
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...; + */ > + 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); > + } else { > + if (virtio_pmem_flush(nd_region)) > + rc = -EIO; > + } > + > + return rc; > +}; > +EXPORT_SYMBOL_GPL(async_pmem_flush); > +MODULE_LICENSE("GPL"); > diff --git a/drivers/nvdimm/virtio_pmem.c b/drivers...
2019 Jun 12
0
[PATCH v12 2/7] virtio-pmem: Add virtio pmem driver
...t;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; > > + } > > + if (virtio_pmem_flush(nd_region)) > > + return -EIO; > > + > > + return 0; > > +}; > > +EXPORT_SYMBOL_GPL(async_pmem_flush); > > +MODULE_LICENSE("GPL"); >...
2019 Apr 26
0
[PATCH v7 2/6] virtio-pmem: Add virtio pmem driver
...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); + } else { + if (virtio_pmem_flush(nd_region)) + rc = -EIO; + } + + return rc; +}; +EXPORT_SYMBOL_GPL(async_pmem_flush); +MODULE_LICENSE("GPL"); diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig index 35897649c24f..9f634a2ed638 100644 --- a...
2019 May 14
0
[PATCH v8 2/6] virtio-pmem: Add virtio pmem driver
...t;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 "int rc" and do directly > > if (virtio_pmem_flush(nd_region)) > return -EIO; and another 'return 0' here :) I don't like return from multiple pla...