summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEvgeniy Polyakov <zbr@ioremap.net>2009-01-19 20:20:36 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-03 14:53:33 -0700
commit3e5510ab0cd73e37b1bf268ec1ec7a071e08a1d5 (patch)
treec50718068f7c5d4736a571974866612f77fa9315 /drivers
parentcac22275ac3ee49a69178bd17c62ac30236308ca (diff)
downloadop-kernel-dev-3e5510ab0cd73e37b1bf268ec1ec7a071e08a1d5.zip
op-kernel-dev-3e5510ab0cd73e37b1bf268ec1ec7a071e08a1d5.tar.gz
Staging: DST: optimize bio allocation.
Use bio prepend feature as suggested by Jens Axboe. Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/dst/export.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/staging/dst/export.c b/drivers/staging/dst/export.c
index 122fe75..80ae4eb 100644
--- a/drivers/staging/dst/export.c
+++ b/drivers/staging/dst/export.c
@@ -33,7 +33,7 @@ int __init dst_export_init(void)
{
int err = -ENOMEM;
- dst_bio_set = bioset_create(32, 32);
+ dst_bio_set = bioset_create(32, sizeof(struct dst_export_priv));
if (!dst_bio_set)
goto err_out_exit;
@@ -424,12 +424,8 @@ static void dst_bio_destructor(struct bio *bio)
__free_page(bv->bv_page);
}
- if (priv) {
- struct dst_node *n = priv->state->node;
-
+ if (priv)
dst_state_put(priv->state);
- mempool_free(priv, n->trans_pool);
- }
bio_free(bio, dst_bio_set);
}
@@ -555,11 +551,8 @@ int dst_process_io(struct dst_state *st)
dst_bio_set);
if (!bio)
goto err_out_exit;
- bio->bi_private = NULL;
- priv = mempool_alloc(st->node->trans_pool, GFP_KERNEL);
- if (!priv)
- goto err_out_free;
+ priv = (struct dst_export_priv *)(((void *)bio) - sizeof (struct dst_export_priv));
priv->state = dst_state_get(st);
priv->bio = bio;
OpenPOWER on IntegriCloud