nvme: reorder parent member of struct nvme_request

The parent field is no longer used in the normal (non-split) I/O path,
so move it down to the default-uninitialized part of struct nvme_request
that is only touched for parent/child I/O.

This also puts it closer to other related fields (children,
child_tailq, parent_status) for improved readability.

Change-Id: I120df1df0c967d2f74daa6e97c0bc83626e3be7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-12-22 16:34:53 -07:00 committed by Gerrit Code Review
parent c0ebf12e3e
commit 16c75b8af7
2 changed files with 7 additions and 5 deletions

View File

@ -106,11 +106,6 @@
struct nvme_request { struct nvme_request {
struct nvme_command cmd; struct nvme_command cmd;
/**
* Points to a parent request if part of a split request,
* NULL otherwise.
*/
struct nvme_request *parent;
union { union {
void *payload; void *payload;
} u; } u;
@ -148,6 +143,12 @@ struct nvme_request {
*/ */
TAILQ_ENTRY(nvme_request) child_tailq; TAILQ_ENTRY(nvme_request) child_tailq;
/**
* Points to a parent request if part of a split request,
* NULL otherwise.
*/
struct nvme_request *parent;
/** /**
* Completion status for a parent request. Initialized to all 0's * Completion status for a parent request. Initialized to all 0's
* (SUCCESS) before child requests are submitted. If a child * (SUCCESS) before child requests are submitted. If a child

View File

@ -75,6 +75,7 @@ nvme_request_add_child(struct nvme_request *parent, struct nvme_request *child)
* relatively rare. * relatively rare.
*/ */
TAILQ_INIT(&parent->children); TAILQ_INIT(&parent->children);
parent->parent = NULL;
memset(&parent->parent_status, 0, sizeof(struct nvme_completion)); memset(&parent->parent_status, 0, sizeof(struct nvme_completion));
} }