The packet writing module creates a bio in its own way, so its iocontext
should be set here.
This code hasn't been tested yet.
Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
--- linux-2.6.25.bio0/drivers/block/pktcdvd.c 2008-04-22 15:48:36.000000000 +0900
+++ linux-2.6.25/drivers/block/pktcdvd.c 2008-04-22 15:53:41.000000000 +0900
@@ -514,6 +514,7 @@ static void pkt_bio_finished(struct pktc
static void pkt_bio_destructor(struct bio *bio)
{
+ put_io_context(bio->bi_io_context);
kfree(bio->bi_io_vec);
kfree(bio);
}
@@ -522,6 +523,11 @@ static struct bio *pkt_bio_alloc(int nr_
{
struct bio_vec *bvl = NULL;
struct bio *bio;
+ struct io_context *ioc;
+
+ ioc = get_io_context(GFP_KERNEL, -1);
+ if (!ioc)
+ goto no_ioc;
bio = kmalloc(sizeof(struct bio), GFP_KERNEL);
if (!bio)
@@ -535,12 +541,15 @@ static struct bio *pkt_bio_alloc(int nr_
bio->bi_max_vecs = nr_iovecs;
bio->bi_io_vec = bvl;
bio->bi_destructor = pkt_bio_destructor;
+ bio->bi_io_context = ioc;
return bio;
no_bvl:
kfree(bio);
no_bio:
+ put_io_context(ioc);
+ no_ioc:
return NULL;
}
--
| Arjan van de Ven | [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Tilman Schmidt | git guidance |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Martin Langhoff | Re: pack operation is thrashing my server |
| Alan Larkin | fatal: Out of memory, malloc failed |
| Mark Junker | git on MacOSX and files with decomposed utf-8 file names |
| Alex Riesen | Re: How do get a specific version of a particular file? |
| Leon Dippenaar | New tcp stack attack |
| Richard Stallman | Real men don't attack straw men |
| Pieter Verberne | Remove escape characters from file |
| Juan Miscaro | removing sendmail |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Chuck Lever | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
