Patchwork Reorganize struct Qcow2Cache for better struct packing

login
register
mail settings
Submitter Jes Sorensen
Date Jan. 27, 2011, 10:25 a.m.
Message ID <1296123903-22521-1-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/80645/
State New
Headers show

Comments

Jes Sorensen - Jan. 27, 2011, 10:25 a.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

Move size after the two pointers in struct Qcow2Cache to get better
packing of struct elements on 64 bit architectures.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 block/qcow2-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Kevin Wolf - Jan. 27, 2011, 11:35 a.m.
Am 27.01.2011 11:25, schrieb Jes.Sorensen@redhat.com:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
> 
> Move size after the two pointers in struct Qcow2Cache to get better
> packing of struct elements on 64 bit architectures.
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>

Thanks, applied to the block branch.

Kevin

Patch

diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 8f2955b..3824739 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -35,9 +35,9 @@  typedef struct Qcow2CachedTable {
 } Qcow2CachedTable;
 
 struct Qcow2Cache {
-    int                     size;
     Qcow2CachedTable*       entries;
     struct Qcow2Cache*      depends;
+    int                     size;
     bool                    depends_on_flush;
     bool                    writethrough;
 };