From patchwork Tue May 5 09:56:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 6336661 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4D0929F440 for ; Tue, 5 May 2015 09:56:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 843B62034B for ; Tue, 5 May 2015 09:56:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E6E42034A for ; Tue, 5 May 2015 09:56:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757365AbbEEJ4p (ORCPT ); Tue, 5 May 2015 05:56:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50280 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757349AbbEEJ4Y (ORCPT ); Tue, 5 May 2015 05:56:24 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t459uOST005531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 May 2015 05:56:24 -0400 Received: from rh2.redhat.com (vpn-61-140.rdu2.redhat.com [10.10.61.140]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t459uKw6026364; Tue, 5 May 2015 05:56:24 -0400 From: mchristi@redhat.com To: ceph-devel@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH 4/5] target: add helper to go from iblock to request queue Date: Tue, 5 May 2015 04:56:17 -0500 Message-Id: <1430819778-24483-5-git-send-email-mchristi@redhat.com> In-Reply-To: <1430819778-24483-1-git-send-email-mchristi@redhat.com> References: <1430819778-24483-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 From: Mike Christie rbd works with block_devices/request_queues. This patch adds a helper so we can easily go from the iblock device to the request queue in the rbd_tcm module. Signed-off-by: Mike Christie --- drivers/target/target_core_iblock.c | 6 ++++++ include/target/target_core_backend.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index d4a4b0f..ab84153 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -53,6 +53,12 @@ static inline struct iblock_dev *IBLOCK_DEV(struct se_device *dev) return container_of(dev, struct iblock_dev, dev); } +struct request_queue *ibock_se_device_to_q(struct se_device *dev) +{ + struct iblock_dev *ib_dev = IBLOCK_DEV(dev); + return bdev_get_queue(ib_dev->ibd_bd); +} +EXPORT_SYMBOL(ibock_se_device_to_q); static struct se_subsystem_api iblock_template; diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index d61be72..1571e68 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h @@ -139,4 +139,8 @@ int se_dev_set_max_sectors(struct se_device *, u32); int se_dev_set_optimal_sectors(struct se_device *, u32); int se_dev_set_block_size(struct se_device *, u32); +/* backend helper to map from se_device to its queue */ +struct request_queue; +struct request_queue *ibock_se_device_to_q(struct se_device *dev); + #endif /* TARGET_CORE_BACKEND_H */