linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: bvanassche@acm.org, hch@lst.de, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	snitzer@kernel.org, axboe@kernel.dk,
	linux-nvme@lists.infradead.org, chaitanyak@nvidia.com,
	kbusch@kernel.org, target-devel@vger.kernel.org
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH v3 16/19] scsi: target: Rename sbc_ops to exec_cmd_ops
Date: Wed, 26 Oct 2022 18:19:42 -0500	[thread overview]
Message-ID: <20221026231945.6609-17-michael.christie@oracle.com> (raw)
In-Reply-To: <20221026231945.6609-1-michael.christie@oracle.com>

The next patches allow us to call the block layer's pr_ops from the
backends. This will require allowing the backends to hook into the cmd
processing for SPC commands, so this renames sbc_ops to a more generic
exec_cmd_ops.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 drivers/target/target_core_file.c    |  4 ++--
 drivers/target/target_core_iblock.c  |  4 ++--
 drivers/target/target_core_rd.c      |  4 ++--
 drivers/target/target_core_sbc.c     | 13 +++++++------
 include/target/target_core_backend.h |  4 ++--
 5 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 28aa643be5d5..8336c0e0b1db 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -903,7 +903,7 @@ static void fd_free_prot(struct se_device *dev)
 	fd_dev->fd_prot_file = NULL;
 }
 
-static struct sbc_ops fd_sbc_ops = {
+static struct exec_cmd_ops fd_exec_cmd_ops = {
 	.execute_rw		= fd_execute_rw,
 	.execute_sync_cache	= fd_execute_sync_cache,
 	.execute_write_same	= fd_execute_write_same,
@@ -913,7 +913,7 @@ static struct sbc_ops fd_sbc_ops = {
 static sense_reason_t
 fd_parse_cdb(struct se_cmd *cmd)
 {
-	return sbc_parse_cdb(cmd, &fd_sbc_ops);
+	return sbc_parse_cdb(cmd, &fd_exec_cmd_ops);
 }
 
 static const struct target_backend_ops fileio_ops = {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 8351c974cee3..5db7318b4822 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -878,7 +878,7 @@ static unsigned int iblock_get_io_opt(struct se_device *dev)
 	return bdev_io_opt(bd);
 }
 
-static struct sbc_ops iblock_sbc_ops = {
+static struct exec_cmd_ops iblock_exec_cmd_ops = {
 	.execute_rw		= iblock_execute_rw,
 	.execute_sync_cache	= iblock_execute_sync_cache,
 	.execute_write_same	= iblock_execute_write_same,
@@ -888,7 +888,7 @@ static struct sbc_ops iblock_sbc_ops = {
 static sense_reason_t
 iblock_parse_cdb(struct se_cmd *cmd)
 {
-	return sbc_parse_cdb(cmd, &iblock_sbc_ops);
+	return sbc_parse_cdb(cmd, &iblock_exec_cmd_ops);
 }
 
 static bool iblock_get_write_cache(struct se_device *dev)
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 6648c1c90e19..6f67cc09c2b5 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -643,14 +643,14 @@ static void rd_free_prot(struct se_device *dev)
 	rd_release_prot_space(rd_dev);
 }
 
-static struct sbc_ops rd_sbc_ops = {
+static struct exec_cmd_ops rd_exec_cmd_ops = {
 	.execute_rw		= rd_execute_rw,
 };
 
 static sense_reason_t
 rd_parse_cdb(struct se_cmd *cmd)
 {
-	return sbc_parse_cdb(cmd, &rd_sbc_ops);
+	return sbc_parse_cdb(cmd, &rd_exec_cmd_ops);
 }
 
 static const struct target_backend_ops rd_mcp_ops = {
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 1e3216de1e04..74133efda529 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -192,7 +192,7 @@ EXPORT_SYMBOL(sbc_get_write_same_sectors);
 static sense_reason_t
 sbc_execute_write_same_unmap(struct se_cmd *cmd)
 {
-	struct sbc_ops *ops = cmd->protocol_data;
+	struct exec_cmd_ops *ops = cmd->protocol_data;
 	sector_t nolb = sbc_get_write_same_sectors(cmd);
 	sense_reason_t ret;
 
@@ -279,7 +279,8 @@ static inline unsigned long long transport_lba_64_ext(unsigned char *cdb)
 }
 
 static sense_reason_t
-sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags, struct sbc_ops *ops)
+sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags,
+		     struct exec_cmd_ops *ops)
 {
 	struct se_device *dev = cmd->se_dev;
 	sector_t end_lba = dev->transport->get_blocks(dev) + 1;
@@ -348,7 +349,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags, struct sbc_ops *op
 static sense_reason_t
 sbc_execute_rw(struct se_cmd *cmd)
 {
-	struct sbc_ops *ops = cmd->protocol_data;
+	struct exec_cmd_ops *ops = cmd->protocol_data;
 
 	return ops->execute_rw(cmd, cmd->t_data_sg, cmd->t_data_nents,
 			       cmd->data_direction);
@@ -564,7 +565,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes
 static sense_reason_t
 sbc_compare_and_write(struct se_cmd *cmd)
 {
-	struct sbc_ops *ops = cmd->protocol_data;
+	struct exec_cmd_ops *ops = cmd->protocol_data;
 	struct se_device *dev = cmd->se_dev;
 	sense_reason_t ret;
 	int rc;
@@ -762,7 +763,7 @@ sbc_check_dpofua(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb)
 }
 
 sense_reason_t
-sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
+sbc_parse_cdb(struct se_cmd *cmd, struct exec_cmd_ops *ops)
 {
 	struct se_device *dev = cmd->se_dev;
 	unsigned char *cdb = cmd->t_task_cdb;
@@ -1074,7 +1075,7 @@ EXPORT_SYMBOL(sbc_get_device_type);
 static sense_reason_t
 sbc_execute_unmap(struct se_cmd *cmd)
 {
-	struct sbc_ops *ops = cmd->protocol_data;
+	struct exec_cmd_ops *ops = cmd->protocol_data;
 	struct se_device *dev = cmd->se_dev;
 	unsigned char *buf, *ptr = NULL;
 	sector_t lba;
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index a3c193df25b3..c5df78959532 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -62,7 +62,7 @@ struct target_backend_ops {
 	struct configfs_attribute **tb_dev_action_attrs;
 };
 
-struct sbc_ops {
+struct exec_cmd_ops {
 	sense_reason_t (*execute_rw)(struct se_cmd *cmd, struct scatterlist *,
 				     u32, enum dma_data_direction);
 	sense_reason_t (*execute_sync_cache)(struct se_cmd *cmd);
@@ -86,7 +86,7 @@ sense_reason_t	spc_emulate_report_luns(struct se_cmd *cmd);
 sense_reason_t	spc_emulate_inquiry_std(struct se_cmd *, unsigned char *);
 sense_reason_t	spc_emulate_evpd_83(struct se_cmd *, unsigned char *);
 
-sense_reason_t	sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops);
+sense_reason_t	sbc_parse_cdb(struct se_cmd *cmd, struct exec_cmd_ops *ops);
 u32	sbc_get_device_rev(struct se_device *dev);
 u32	sbc_get_device_type(struct se_device *dev);
 sector_t	sbc_get_write_same_sectors(struct se_cmd *cmd);
-- 
2.25.1



  parent reply	other threads:[~2022-10-26 23:24 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 23:19 [PATCH v3 00/19] Use block pr_ops in LIO Mike Christie
2022-10-26 23:19 ` [PATCH v3 01/19] block: Add PR callouts for read keys and reservation Mike Christie
2022-11-02 22:50   ` Bart Van Assche
2022-11-03  1:54     ` Mike Christie
2022-11-02 22:53   ` Bart Van Assche
2022-11-03  2:25     ` Mike Christie
2022-10-26 23:19 ` [PATCH v3 02/19] scsi: Rename sd_pr_command Mike Christie
2022-11-01  5:33   ` Chaitanya Kulkarni
2022-10-26 23:19 ` [PATCH v3 03/19] scsi: Move sd_pr_type to header to share Mike Christie
2022-11-01  5:43   ` Chaitanya Kulkarni
2022-11-01 16:43     ` Mike Christie
2022-11-02 22:47   ` Bart Van Assche
2022-11-03  2:13     ` Mike Christie
2022-11-03 18:14       ` Bart Van Assche
2022-10-26 23:19 ` [PATCH v3 04/19] scsi: Add support for block PR read keys/reservation Mike Christie
2022-10-27  6:08   ` kernel test robot
2022-10-27  7:59   ` kernel test robot
2022-10-27 10:41   ` kernel test robot
2022-11-01  5:45   ` Chaitanya Kulkarni
2022-11-02 22:54   ` Bart Van Assche
2022-10-26 23:19 ` [PATCH v3 05/19] dm: " Mike Christie
2022-10-26 23:19 ` [PATCH v3 06/19] nvme: Fix reservation status related structs Mike Christie
2022-10-27 17:04   ` Keith Busch
2022-10-26 23:19 ` [PATCH v3 07/19] nvme: Don't hardcode the data len for pr commands Mike Christie
2022-10-27 17:05   ` Keith Busch
2022-11-01  5:29   ` Chaitanya Kulkarni
2022-10-26 23:19 ` [PATCH v3 08/19] nvme: Move pr code to it's own file Mike Christie
2022-10-27 17:06   ` Keith Busch
2022-10-28 16:06     ` Mike Christie
2022-10-28 16:38       ` Keith Busch
2022-10-30  8:06         ` Christoph Hellwig
2022-11-01  5:25   ` Chaitanya Kulkarni
2022-10-26 23:19 ` [PATCH v3 09/19] nvme: Add pr_ops read_keys support Mike Christie
2022-10-30  8:17   ` Christoph Hellwig
2022-10-30 20:47     ` Mike Christie
2022-10-26 23:19 ` [PATCH v3 10/19] nvme: Move NVMe and Block PR types to an array Mike Christie
2022-10-27 15:18   ` Keith Busch
2022-10-27 17:06     ` Mike Christie
2022-10-27 17:13       ` michael.christie
2022-10-27 17:16         ` Keith Busch
2022-10-28 16:05           ` Mike Christie
2022-10-26 23:19 ` [PATCH v3 11/19] nvme: Add pr_ops read_reservation support Mike Christie
2022-10-30  8:18   ` Christoph Hellwig
2022-10-30 20:54     ` Mike Christie
2022-10-26 23:19 ` [PATCH v3 12/19] block,nvme,scsi,dm: Add blk_status to pr_ops callouts Mike Christie
2022-10-30  8:20   ` Christoph Hellwig
2022-10-30 23:05     ` Mike Christie
2022-11-01 10:15       ` Christoph Hellwig
2022-11-05 18:36         ` Mike Christie
2022-11-07  9:16           ` Christoph Hellwig
2022-10-26 23:19 ` [PATCH v3 13/19] nvme: Have NVMe pr_ops return a blk_status_t Mike Christie
2022-10-26 23:19 ` [PATCH v3 14/19] scsi: Export scsi_result_to_blk_status Mike Christie
2022-10-26 23:19 ` [PATCH v3 15/19] scsi: Have sd pr_ops return a blk_status_t Mike Christie
2022-10-26 23:19 ` Mike Christie [this message]
2022-10-26 23:19 ` [PATCH v3 17/19] scsi: target: Allow backends to hook into PR handling Mike Christie
2022-10-26 23:19 ` [PATCH v3 18/19] scsi: target: Don't support SCSI-2 RESERVE/RELEASE Mike Christie
2022-10-26 23:19 ` [PATCH v3 19/19] scsi: target: Add block PR support to iblock 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=20221026231945.6609-17-michael.christie@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=chaitanyak@nvidia.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=snitzer@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).