Commit 05faf8e7 authored by zhenwei pi's avatar zhenwei pi Committed by Tomasz Zawadzki
Browse files

scsi: Re-order struct spdk_scsi_lun



Move *removed* and *resizing* to the front of struct spdk_scsi_lun,
there are 2 benefits:
- reduce memory
- the two fields work in hot path, they are tested on each task
  execution

Also move *ref* to the neighbor of *pr_generation*. Finally, we reduce
16 bytes(1080 -> 1064).

Change-Id: Ia3705a0e765fc5183fce836eb8f6684a79cd1353
Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21923


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
parent a91b02b2
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -85,6 +85,12 @@ struct spdk_scsi_lun {
	/** LUN id for this logical unit. */
	int id;

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

	/** The LUN is resizing */
	bool resizing;

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

@@ -100,15 +106,9 @@ struct spdk_scsi_lun {
	/** I/O channel for the bdev associated with this LUN. */
	struct spdk_io_channel *io_channel;

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

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

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

	/** Callback to be fired when LUN removal is first triggered. */
	void (*hotremove_cb)(const struct spdk_scsi_lun *lun, void *arg);

@@ -142,8 +142,8 @@ struct spdk_scsi_lun {
	/** A structure to connect LUNs in a list. */
	TAILQ_ENTRY(spdk_scsi_lun) tailq;

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

	/** Persistent Reservation Generation */
	uint32_t pr_generation;