From patchwork Fri May 8 06:04:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 6362551 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EADEBBEEE1 for ; Fri, 8 May 2015 06:04:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16DA2203A9 for ; Fri, 8 May 2015 06:04:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8ED72039E for ; Fri, 8 May 2015 06:04:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752008AbbEHGE3 (ORCPT ); Fri, 8 May 2015 02:04:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43237 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612AbbEHGE2 (ORCPT ); Fri, 8 May 2015 02:04:28 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t486469S026917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 8 May 2015 02:04:06 -0400 Received: from [10.10.56.106] (vpn-56-106.rdu2.redhat.com [10.10.56.106]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t48645Zl016442; Fri, 8 May 2015 02:04:05 -0400 Message-ID: <554C51D5.30202@redhat.com> Date: Fri, 08 May 2015 01:04:05 -0500 From: Mike Christie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Christoph Hellwig CC: ceph-devel@vger.kernel.org, target-devel@vger.kernel.org Subject: Re: [PATCH 0/5] target/rbd: distributed lun reset support References: <1430819778-24483-1-git-send-email-mchristi@redhat.com> <20150505174939.GA21297@infradead.org> <55499D46.9040008@redhat.com> <20150506064812.GA5181@infradead.org> In-Reply-To: <20150506064812.GA5181@infradead.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 On 05/06/2015 01:48 AM, Christoph Hellwig wrote: >>> As for the API: I would much prefer to have things at the block layer >>> in some form than adding side band protocol for specific functionality. >>> >> >> Ok. For what you need for your NFS cluster work, will you have a >> request_queue or block_device or gendisk? > > All of them. It's just another consumer of the in-kernel block devices > interface. Will users use lio with what you are working on? I ask because I am thinking it might be better to implement my own se_subsystem_api and sbc_ops structs and in my backend just make libceph calls directly for callouts like sbc_ops->execute_rw. So I would not have a block_device or request_queue if I went that route. If I do my own backend, for reset support (PR support will be similar with callouts added to the se_subsystem_api) I would just need the patch below. --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 315ec34..b5a3b68 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -323,7 +323,7 @@ static void core_tmr_drain_state_list( } } -int core_tmr_lun_reset( +int target_core_local_tmr_lun_reset( struct se_device *dev, struct se_tmr_req *tmr, struct list_head *preempt_and_abort_list, @@ -386,4 +386,18 @@ int core_tmr_lun_reset( dev->transport->name); return 0; } +EXPORT_SYMBOL(target_core_local_tmr_lun_reset); +int core_tmr_lun_reset( + struct se_device *dev, + struct se_tmr_req *tmr, + struct list_head *preempt_and_abort_list, + struct se_cmd *prout_cmd) +{ + if (dev->transport->reset_device) + return dev->transport->reset_device(dev); + else + return target_core_local_tmr_lun_reset(dev, tmr, + preempt_and_abort_list, + prout_cmd); +} diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index d61be72..faad6c4 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h @@ -31,6 +31,7 @@ struct se_subsystem_api { struct se_device *(*alloc_device)(struct se_hba *, const char *); int (*configure_device)(struct se_device *); void (*free_device)(struct se_device *device); + int (*reset_device)(struct se_device *); ssize_t (*set_configfs_dev_params)(struct se_device *, const char *, ssize_t); @@ -139,4 +139,7 @@ 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); +int target_core_local_tmr_lun_reset(struct se_device *, struct se_tmr_req *, + struct list_head *, struct se_cmd *); + #endif /* TARGET_CORE_BACKEND_H */