Commit 12965bb6 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

scsi: make spdk_scsi_lun definition private



The contents of struct spdk_scsi_lun don't need to be part of the public
API.

Change-Id: I101b77871054557380610fd901ab38bada463202
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 77f23fe3
Loading
Loading
Loading
Loading
+3 −38
Original line number Diff line number Diff line
@@ -192,45 +192,10 @@ struct spdk_scsi_dev {
 * malloc LUNs will implement scsi_execute to translate the SCSI task and
 * copy the task's data into or out of the allocated memory buffer.
 */
struct spdk_scsi_lun {
	/** LUN id for this logical unit. */
	int id;

	/** Pointer to the SCSI device containing this LUN. */
	struct spdk_scsi_dev *dev;

	/** The blockdev associated with this LUN. */
	struct spdk_bdev *bdev;
struct spdk_scsi_lun;

	/** I/O channel for the blockdev associated with this LUN. */
	struct spdk_io_channel *io_channel;

	/** Thread ID for the thread that allocated the I/O channel for this
	 *   LUN.  All I/O to this LUN must be performed from this thread.
	 */
	pthread_t thread_id;

	/**  The reference number for this LUN, thus we can correctly free the io_channel */
	uint32_t ref;

	/** Name for this LUN. */
	char name[SPDK_SCSI_LUN_MAX_NAME_LENGTH];

	/** Poller to release the resource of the lun when it is hot removed */
	struct spdk_poller *hotplug_poller;

	/** The core hotplug_poller is assigned */
	uint32_t			lcore;

	/** The LUN is removed */
	bool				removed;

	/** The LUN is clamed */
	bool claimed;

	TAILQ_HEAD(tasks, spdk_scsi_task) tasks;			/* submitted tasks */
	TAILQ_HEAD(pending_tasks, spdk_scsi_task) pending_tasks;	/* pending tasks */
};
int spdk_scsi_lun_get_id(const struct spdk_scsi_lun *lun);
const char *spdk_scsi_lun_get_name(const struct spdk_scsi_lun *lun);

void spdk_scsi_dev_destruct(struct spdk_scsi_dev *dev);
void spdk_scsi_dev_queue_mgmt_task(struct spdk_scsi_dev *dev, struct spdk_scsi_task *task);
+1 −1
Original line number Diff line number Diff line
@@ -4162,7 +4162,7 @@ spdk_iscsi_send_r2t(struct spdk_iscsi_conn *conn,
	rsp_pdu->data = NULL;
	rsph->opcode = ISCSI_OP_R2T;
	rsph->flags |= 0x80; /* bit 0 is default to 1 */
	to_be64(&rsph->lun, task->scsi.lun->id);
	to_be64(&rsph->lun, spdk_scsi_lun_get_id(task->scsi.lun));
	to_be32(&rsph->itt, task->scsi.id);
	to_be32(&rsph->ttt, transfer_tag);

+2 −2
Original line number Diff line number Diff line
@@ -349,9 +349,9 @@ spdk_rpc_get_target_nodes(struct spdk_jsonrpc_server_conn *conn,
			if (tgtnode->dev->lun[i]) {
				spdk_json_write_object_begin(w);
				spdk_json_write_name(w, "name");
				spdk_json_write_string(w, tgtnode->dev->lun[i]->name);
				spdk_json_write_string(w, spdk_scsi_lun_get_name(tgtnode->dev->lun[i]));
				spdk_json_write_name(w, "id");
				spdk_json_write_int32(w, tgtnode->dev->lun[i]->id);
				spdk_json_write_int32(w, spdk_scsi_lun_get_id(tgtnode->dev->lun[i]));
				spdk_json_write_object_end(w);
			}
		}
+2 −2
Original line number Diff line number Diff line
@@ -289,8 +289,8 @@ spdk_iscsi_config_dump_target_nodes(FILE *fp)
			if (NULL == dev->lun[l]) continue;

			fprintf(fp, TARGET_NODE_LUN_TMPL,
				dev->lun[l]->id,
				dev->lun[l]->name);
				spdk_scsi_lun_get_id(dev->lun[l]),
				spdk_scsi_lun_get_name(dev->lun[l]));
		}

		fprintf(fp, TARGET_NODE_QD_TMPL,
+12 −0
Original line number Diff line number Diff line
@@ -431,3 +431,15 @@ void spdk_scsi_lun_free_io_channel(struct spdk_scsi_lun *lun)
		}
	}
}

int
spdk_scsi_lun_get_id(const struct spdk_scsi_lun *lun)
{
	return lun->id;
}

const char *
spdk_scsi_lun_get_name(const struct spdk_scsi_lun *lun)
{
	return lun->name;
}
Loading