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: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
77f23fe3fa
commit
12965bb6ce
@ -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;
|
||||
struct spdk_scsi_lun;
|
||||
|
||||
/** Pointer to the SCSI device containing this LUN. */
|
||||
struct spdk_scsi_dev *dev;
|
||||
|
||||
/** The blockdev associated with this LUN. */
|
||||
struct spdk_bdev *bdev;
|
||||
|
||||
/** 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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -81,6 +81,46 @@ enum {
|
||||
SPDK_SCSI_TASK_PENDING,
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
/** 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 */
|
||||
};
|
||||
|
||||
struct spdk_lun_db_entry {
|
||||
struct spdk_scsi_lun *lun;
|
||||
struct spdk_lun_db_entry *next;
|
||||
|
@ -60,10 +60,10 @@ json_scsi_dev_write(struct spdk_json_write_ctx *ctx, struct spdk_scsi_dev *dev)
|
||||
spdk_json_write_object_begin(ctx);
|
||||
|
||||
spdk_json_write_name(ctx, "id");
|
||||
spdk_json_write_int32(ctx, (int32_t)dev->lun[l]->id);
|
||||
spdk_json_write_int32(ctx, spdk_scsi_lun_get_id(dev->lun[l]));
|
||||
|
||||
spdk_json_write_name(ctx, "name");
|
||||
spdk_json_write_string(ctx, dev->lun[l]->name);
|
||||
spdk_json_write_string(ctx, spdk_scsi_lun_get_name(dev->lun[l]));
|
||||
|
||||
spdk_json_write_object_end(ctx);
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "../common.c"
|
||||
#include "iscsi/acceptor.h"
|
||||
#include "iscsi/portal_grp.h"
|
||||
#include "scsi/scsi_internal.h"
|
||||
|
||||
struct spdk_iscsi_tgt_node *
|
||||
spdk_iscsi_find_tgt_node(const char *target_name)
|
||||
@ -82,6 +83,12 @@ spdk_iscsi_conn_free_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pd
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
spdk_scsi_lun_get_id(const struct spdk_scsi_lun *lun)
|
||||
{
|
||||
return lun->id;
|
||||
}
|
||||
|
||||
static void
|
||||
maxburstlength_test(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user