From patchwork Mon Apr 10 16:08:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9673131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE4B0600CB for ; Mon, 10 Apr 2017 16:08:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D651727C05 for ; Mon, 10 Apr 2017 16:08:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9F402845C; Mon, 10 Apr 2017 16:08:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79BB127C05 for ; Mon, 10 Apr 2017 16:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751812AbdDJQIc (ORCPT ); Mon, 10 Apr 2017 12:08:32 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:57044 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbdDJQI2 (ORCPT ); Mon, 10 Apr 2017 12:08:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mT4quMKnmk80/qV4/Kbr9wGK+S93dJd2uiJmMQAIEe8=; b=hhkXVmwfWZJKrcSrlTkjN8e8u 3XLZM4ssxvPydDfDYcuy2gW3m6gFgauVA/K9jvSh28SI1Ul3ffc2MDyZ64mtTEz1/lWsEGZQfjYbp PjrVWRCfmCPAMHvNsS5aJ9w6w5yua+IVEH+DooD8aHMGllijBBMDqTAQF2jykGw0n5ec5uVrZRVp2 u9aR8nwf7++g4ed+ALpC7rGSzE2qQoeWlRuuJpFfI9s1dH2uvh9qI0LmerFO59CC4tSpQh4VJ/T5y 7u0vURNTl1rOfgJEGPJfdzbpMO4ca646qUiBh+pVyxrQAAGc9Nc27uyifdugVBTsC1ORbu4dpYKcb uyR45tAuQ==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cxbrU-0008Mi-3n; Mon, 10 Apr 2017 16:08:16 +0000 From: Christoph Hellwig To: axboe@kernel.dk, martin.petersen@oracle.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, target-devel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, drbd-dev@lists.linbit.com, dm-devel@redhat.com Subject: [PATCH 2/8] target: remove iblock WRITE_SAME passthrough support Date: Mon, 10 Apr 2017 18:08:01 +0200 Message-Id: <20170410160807.23674-3-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410160807.23674-1-hch@lst.de> References: <20170410160807.23674-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the pscsi driver to support arbitrary command passthrough instead. Signed-off-by: Christoph Hellwig --- drivers/target/target_core_iblock.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index d316ed537d59..9da31970a004 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -415,39 +415,8 @@ iblock_execute_unmap(struct se_cmd *cmd, sector_t lba, sector_t nolb) } static sense_reason_t -iblock_execute_write_same_direct(struct block_device *bdev, struct se_cmd *cmd) -{ - struct se_device *dev = cmd->se_dev; - struct scatterlist *sg = &cmd->t_data_sg[0]; - struct page *page = NULL; - int ret; - - if (sg->offset) { - page = alloc_page(GFP_KERNEL); - if (!page) - return TCM_OUT_OF_RESOURCES; - sg_copy_to_buffer(sg, cmd->t_data_nents, page_address(page), - dev->dev_attrib.block_size); - } - - ret = blkdev_issue_write_same(bdev, - target_to_linux_sector(dev, cmd->t_task_lba), - target_to_linux_sector(dev, - sbc_get_write_same_sectors(cmd)), - GFP_KERNEL, page ? page : sg_page(sg)); - if (page) - __free_page(page); - if (ret) - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; - - target_complete_cmd(cmd, GOOD); - return 0; -} - -static sense_reason_t iblock_execute_write_same(struct se_cmd *cmd) { - struct block_device *bdev = IBLOCK_DEV(cmd->se_dev)->ibd_bd; struct iblock_req *ibr; struct scatterlist *sg; struct bio *bio; @@ -472,9 +441,6 @@ iblock_execute_write_same(struct se_cmd *cmd) return TCM_INVALID_CDB_FIELD; } - if (bdev_write_same(bdev)) - return iblock_execute_write_same_direct(bdev, cmd); - ibr = kzalloc(sizeof(struct iblock_req), GFP_KERNEL); if (!ibr) goto fail;