Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6193f06e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nicholas Bellinger
Browse files

target: make the ->get_cdb method optional



The most commonly used file, iblock and rd backends have no use for
a per-task CDB and thus don't need a method to copy it into their
otherwise unused CDB fields.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 3189b067
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -609,17 +609,6 @@ static ssize_t fd_show_configfs_dev_params(
	return bl;
}

/*	fd_get_cdb(): (Part of se_subsystem_api_t template)
 *
 *
 */
static unsigned char *fd_get_cdb(struct se_task *task)
{
	struct fd_request *req = FILE_REQ(task);

	return req->fd_scsi_cdb;
}

/*	fd_get_device_rev(): (Part of se_subsystem_api_t template)
 *
 *
@@ -667,7 +656,6 @@ static struct se_subsystem_api fileio_template = {
	.check_configfs_dev_params = fd_check_configfs_dev_params,
	.set_configfs_dev_params = fd_set_configfs_dev_params,
	.show_configfs_dev_params = fd_show_configfs_dev_params,
	.get_cdb		= fd_get_cdb,
	.get_device_rev		= fd_get_device_rev,
	.get_device_type	= fd_get_device_type,
	.get_blocks		= fd_get_blocks,
+1 −3
Original line number Diff line number Diff line
@@ -14,9 +14,7 @@

struct fd_request {
	struct se_task	fd_task;
	/* SCSI CDB from iSCSI Command PDU */
	unsigned char	fd_scsi_cdb[TCM_MAX_COMMAND_SIZE];
} ____cacheline_aligned;
};

#define FBDF_HAS_PATH		0x01
#define FBDF_HAS_SIZE		0x02
+0 −6
Original line number Diff line number Diff line
@@ -618,11 +618,6 @@ fail:
	return PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES;
}

static unsigned char *iblock_get_cdb(struct se_task *task)
{
	return IBLOCK_REQ(task)->ib_scsi_cdb;
}

static u32 iblock_get_device_rev(struct se_device *dev)
{
	return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */
@@ -696,7 +691,6 @@ static struct se_subsystem_api iblock_template = {
	.check_configfs_dev_params = iblock_check_configfs_dev_params,
	.set_configfs_dev_params = iblock_set_configfs_dev_params,
	.show_configfs_dev_params = iblock_show_configfs_dev_params,
	.get_cdb		= iblock_get_cdb,
	.get_device_rev		= iblock_get_device_rev,
	.get_device_type	= iblock_get_device_type,
	.get_blocks		= iblock_get_blocks,
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@

struct iblock_req {
	struct se_task ib_task;
	unsigned char ib_scsi_cdb[TCM_MAX_COMMAND_SIZE];
	atomic_t ib_bio_cnt;
	atomic_t ib_bio_err_cnt;
} ____cacheline_aligned;
+0 −12
Original line number Diff line number Diff line
@@ -691,17 +691,6 @@ static ssize_t rd_show_configfs_dev_params(
	return bl;
}

/*	rd_get_cdb(): (Part of se_subsystem_api_t template)
 *
 *
 */
static unsigned char *rd_get_cdb(struct se_task *task)
{
	struct rd_request *req = RD_REQ(task);

	return req->rd_scsi_cdb;
}

static u32 rd_get_device_rev(struct se_device *dev)
{
	return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */
@@ -735,7 +724,6 @@ static struct se_subsystem_api rd_mcp_template = {
	.check_configfs_dev_params = rd_check_configfs_dev_params,
	.set_configfs_dev_params = rd_set_configfs_dev_params,
	.show_configfs_dev_params = rd_show_configfs_dev_params,
	.get_cdb		= rd_get_cdb,
	.get_device_rev		= rd_get_device_rev,
	.get_device_type	= rd_get_device_type,
	.get_blocks		= rd_get_blocks,
Loading