From patchwork Fri Jun 19 07:50:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiyoshi Ueda X-Patchwork-Id: 31308 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5J7oxZw001034 for ; Fri, 19 Jun 2009 07:50:59 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id B16C0618624; Fri, 19 Jun 2009 03:50:58 -0400 (EDT) Received: from int-mx2.corp.redhat.com ([172.16.27.26]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n5J7ov9l021691 for ; Fri, 19 Jun 2009 03:50:57 -0400 Received: from mx2.redhat.com (mx2.redhat.com [10.255.15.25]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5J7ovTt020399; Fri, 19 Jun 2009 03:50:57 -0400 Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5J7ohLl007535; Fri, 19 Jun 2009 03:50:43 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.192]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n5J7of0P023997; Fri, 19 Jun 2009 16:50:41 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id n5J7of511891; Fri, 19 Jun 2009 16:50:41 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id n5J7ofj5010981; Fri, 19 Jun 2009 16:50:41 +0900 (JST) Received: from elcondor.linux.bs1.fc.nec.co.jp (elcondor.linux.bs1.fc.nec.co.jp [10.34.125.195]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 1121BE482EB; Fri, 19 Jun 2009 16:50:41 +0900 (JST) Message-ID: <4A3B4350.10209@ct.jp.nec.com> Date: Fri, 19 Jun 2009 16:50:40 +0900 From: Kiyoshi Ueda User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Alasdair Kergon References: <4A3B40D4.1040905@ct.jp.nec.com> In-Reply-To: <4A3B40D4.1040905@ct.jp.nec.com> X-RedHat-Spam-Score: 0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-Scanned-By: MIMEDefang 2.63 on 10.255.15.25 X-loop: dm-devel@redhat.com Cc: device-mapper development Subject: [dm-devel] [PATCH 3/4] dm core: remove 'md' argument from free_rq_tio() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com This patch removes the unneeded argument 'md' from free_rq_tio(). 'md' can be gotten by tio->md in free_rq_tio(), so removed it from argument. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Cc: Alasdair G Kergon --- drivers/md/dm.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: 2.6.31-rc/drivers/md/dm.c =================================================================== --- 2.6.31-rc.orig/drivers/md/dm.c +++ 2.6.31-rc/drivers/md/dm.c @@ -434,9 +434,9 @@ static struct dm_rq_target_io *alloc_rq_ return mempool_alloc(md->tio_pool, GFP_ATOMIC); } -static void free_rq_tio(struct mapped_device *md, struct dm_rq_target_io *tio) +static void free_rq_tio(struct dm_rq_target_io *tio) { - mempool_free(tio, md->tio_pool); + mempool_free(tio, tio->md->tio_pool); } static struct dm_rq_clone_bio_info *alloc_bio_info(struct mapped_device *md) @@ -444,10 +444,9 @@ static struct dm_rq_clone_bio_info *allo return mempool_alloc(md->io_pool, GFP_ATOMIC); } -static void free_bio_info(struct mapped_device *md, - struct dm_rq_clone_bio_info *info) +static void free_bio_info(struct dm_rq_clone_bio_info *info) { - mempool_free(info, md->io_pool); + mempool_free(info, info->tio->md->io_pool); } static void start_io_acct(struct dm_io *io) @@ -759,7 +758,7 @@ static void dm_unprep_request(struct req rq->cmd_flags &= ~REQ_DONTPREP; free_bio_clone(clone); - free_rq_tio(tio->md, tio); + free_rq_tio(tio); } /* @@ -838,7 +837,7 @@ static void dm_end_request(struct reques } BUG_ON(clone->bio); - free_rq_tio(md, tio); + free_rq_tio(tio); blk_end_request_all(rq, error); @@ -1393,7 +1392,7 @@ static void dm_rq_bio_destructor(struct struct dm_rq_clone_bio_info *info = bio->bi_private; struct mapped_device *md = info->tio->md; - free_bio_info(md, info); + free_bio_info(info); bio_free(bio, md->bs); } @@ -1426,10 +1425,13 @@ static int clone_request_bios(struct req if (!info) goto free_and_out; + info->tio = tio; + info->orig = bio; + clone_bio = bio_alloc_bioset(GFP_ATOMIC, bio->bi_max_vecs, md->bs); if (!clone_bio) { - free_bio_info(md, info); + free_bio_info(info); goto free_and_out; } @@ -1438,14 +1440,12 @@ static int clone_request_bios(struct req if (bio_integrity(bio) && !bio_integrity_clone(clone_bio, bio, GFP_ATOMIC)) { bio_free(clone_bio, md->bs); - free_bio_info(md, info); + free_bio_info(info); goto free_and_out; } clone_bio->bi_destructor = dm_rq_bio_destructor; clone_bio->bi_end_io = end_clone_bio; - info->tio = tio; - info->orig = bio; clone_bio->bi_private = info; if (clone->bio) { @@ -1522,7 +1522,7 @@ static int dm_prep_fn(struct request_que clone = &tio->clone; if (setup_clone(clone, rq, tio)) { /* -ENOMEM */ - free_rq_tio(md, tio); + free_rq_tio(tio); return BLKPREP_DEFER; }