All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <mchristi@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: ceph-devel@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH 0/5] target/rbd: distributed lun reset support
Date: Fri, 08 May 2015 01:04:05 -0500	[thread overview]
Message-ID: <554C51D5.30202@redhat.com> (raw)
In-Reply-To: <20150506064812.GA5181@infradead.org>

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.


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 */


  reply	other threads:[~2015-05-08  6:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  9:56 [PATCH 0/5] target/rbd: distributed lun reset support mchristi
2015-05-05  9:56 ` [PATCH 1/5] rbd: rename rbd.c to rbd_main.c mchristi
2015-05-05  9:56 ` [PATCH 2/5] target: add cluster device init hooks mchristi
2015-05-05  9:56 ` [PATCH 3/5] target: lun reset cluster hook into support mchristi
2015-05-05  9:56 ` [PATCH 4/5] target: add helper to go from iblock to request queue mchristi
2015-05-05  9:56 ` [PATCH 5/5] rbd: implment lio cluster api module mchristi
2015-05-05 17:49 ` [PATCH 0/5] target/rbd: distributed lun reset support Christoph Hellwig
2015-05-06  4:49   ` Mike Christie
2015-05-06  6:48     ` Christoph Hellwig
2015-05-08  6:04       ` Mike Christie [this message]
2015-05-08  7:02         ` Nicholas A. Bellinger
2015-05-09 14:29         ` Christoph Hellwig
2015-05-06  4:56 ` Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554C51D5.30202@redhat.com \
    --to=mchristi@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.