From patchwork Thu Jun 5 13:11:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 4305141 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30BFABEEA7 for ; Thu, 5 Jun 2014 13:13:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6819620274 for ; Thu, 5 Jun 2014 13:13:56 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mail.kernel.org (Postfix) with ESMTP id 785432034E for ; Thu, 5 Jun 2014 13:13:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s55DBXQ0030897; Thu, 5 Jun 2014 09:11:33 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s55DBKhT005581 for ; Thu, 5 Jun 2014 09:11:20 -0400 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s55DBKHG012913; Thu, 5 Jun 2014 09:11:20 -0400 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s55DB95T021920; Thu, 5 Jun 2014 09:11:09 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A8EEBAD30; Thu, 5 Jun 2014 13:11:08 +0000 (UTC) From: Hannes Reinecke To: Alasdair Kergon Date: Thu, 5 Jun 2014 15:11:04 +0200 Message-Id: <1401973867-121561-5-git-send-email-hare@suse.de> In-Reply-To: <1401973867-121561-1-git-send-email-hare@suse.de> References: <1401973867-121561-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -7.95 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Cc: "Jun'ichi Nomura" , Christoph Hellwig , dm-devel@redhat.com, Mike Snitzer Subject: [dm-devel] [PATCH 4/7] dm: open-code dm_kill_unmapped_request() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Hannes Reinecke --- drivers/md/dm.c | 24 +++++------------------- include/linux/device-mapper.h | 1 - 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f55ca0c..5109c76 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1015,22 +1015,6 @@ static void dm_complete_request(struct request *clone, int error) } /* - * Complete the not-mapped clone and the original request with the error status - * through softirq context. - * Target's rq_end_io() function isn't called. - * This may be used when the target's map_rq() function fails. - */ -void dm_kill_unmapped_request(struct request *clone, int error) -{ - struct dm_rq_target_io *tio = clone->end_io_data; - struct request *rq = tio->orig; - - rq->cmd_flags |= REQ_FAILED; - dm_complete_request(clone, error); -} -EXPORT_SYMBOL_GPL(dm_kill_unmapped_request); - -/* * Called with the queue lock held */ static void end_clone_request(struct request *clone, int error) @@ -1631,7 +1615,8 @@ static int map_request(struct dm_target *ti, struct request *clone, } /* The target wants to complete the I/O */ - dm_kill_unmapped_request(clone, r); + rq->cmd_flags |= REQ_FAILED; + dm_complete_request(clone, r); break; } @@ -1691,11 +1676,12 @@ static void dm_request_fn(struct request_queue *q) if (!dm_target_is_valid(ti)) { /* * Must perform setup, that dm_done() requires, - * before calling dm_kill_unmapped_request + * before calling dm_complete_request */ DMERR_LIMIT("request attempted access beyond the end of device"); clone = dm_start_request(md, rq); - dm_kill_unmapped_request(clone, -EIO); + rq->cmd_flags |= REQ_FAILED; + dm_complete_request(clone, -EIO); continue; } diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 63da56e..3ad5db8 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -604,7 +604,6 @@ static inline unsigned long to_bytes(sector_t n) *---------------------------------------------------------------*/ void dm_dispatch_request(struct request *rq); void dm_requeue_unmapped_request(struct request *rq); -void dm_kill_unmapped_request(struct request *rq, int error); int dm_underlying_device_busy(struct request_queue *q); #endif /* _LINUX_DEVICE_MAPPER_H */