From 16c75b8af771aa628ce20b25cde6ea717ef91747 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 22 Dec 2015 16:34:53 -0700 Subject: [PATCH] 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 --- lib/nvme/nvme_internal.h | 11 ++++++----- lib/nvme/nvme_ns_cmd.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/nvme/nvme_internal.h b/lib/nvme/nvme_internal.h index 7541ddbd9..a83d78c39 100644 --- a/lib/nvme/nvme_internal.h +++ b/lib/nvme/nvme_internal.h @@ -106,11 +106,6 @@ struct nvme_request { struct nvme_command cmd; - /** - * Points to a parent request if part of a split request, - * NULL otherwise. - */ - struct nvme_request *parent; union { void *payload; } u; @@ -148,6 +143,12 @@ struct nvme_request { */ 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 * (SUCCESS) before child requests are submitted. If a child diff --git a/lib/nvme/nvme_ns_cmd.c b/lib/nvme/nvme_ns_cmd.c index 65446800c..7e94878dd 100644 --- a/lib/nvme/nvme_ns_cmd.c +++ b/lib/nvme/nvme_ns_cmd.c @@ -75,6 +75,7 @@ nvme_request_add_child(struct nvme_request *parent, struct nvme_request *child) * relatively rare. */ TAILQ_INIT(&parent->children); + parent->parent = NULL; memset(&parent->parent_status, 0, sizeof(struct nvme_completion)); }