ext4: naturally align struct ext4_allocation_request

As Ted noted, the ext4_allocation_request isn't well aligned. Looking
at it with pahole we're wasting space on 64-bit arches:

struct ext4_allocation_request {
struct inode * inode; /* 0 8 */
ext4_lblk_t logical; /* 8 4 */

/* XXX 4 bytes hole, try to pack */

ext4_fsblk_t goal; /* 16 8 */
ext4_lblk_t lleft; /* 24 4 */

/* XXX 4 bytes hole, try to pack */

ext4_fsblk_t pleft; /* 32 8 */
ext4_lblk_t lright; /* 40 4 */

/* XXX 4 bytes hole, try to pack */

ext4_fsblk_t pright; /* 48 8 */
unsigned int len; /* 56 4 */
unsigned int flags; /* 60 4 */
/* --- cacheline 1 boundary (64 bytes) --- */

/* size: 64, cachelines: 1, members: 9 */
/* sum members: 52, holes: 3, sum holes: 12 */
};

Grouping 32-bit members together closes these holes and shrinks the
structure by 12 bytes. which is important since ext4 can get on the
hairy edge of stack overruns.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

authored by Eric Sandeen and committed by Theodore Ts'o 726447d8 089ceecc

+12 -12
+12 -12
fs/ext4/ext4.h
··· 93 93 struct ext4_allocation_request { 94 94 /* target inode for block we're allocating */ 95 95 struct inode *inode; 96 - /* logical block in target inode */ 97 - ext4_lblk_t logical; 98 - /* phys. target (a hint) */ 99 - ext4_fsblk_t goal; 100 - /* the closest logical allocated block to the left */ 101 - ext4_lblk_t lleft; 102 - /* phys. block for ^^^ */ 103 - ext4_fsblk_t pleft; 104 - /* the closest logical allocated block to the right */ 105 - ext4_lblk_t lright; 106 - /* phys. block for ^^^ */ 107 - ext4_fsblk_t pright; 108 96 /* how many blocks we want to allocate */ 109 97 unsigned int len; 98 + /* logical block in target inode */ 99 + ext4_lblk_t logical; 100 + /* the closest logical allocated block to the left */ 101 + ext4_lblk_t lleft; 102 + /* the closest logical allocated block to the right */ 103 + ext4_lblk_t lright; 104 + /* phys. target (a hint) */ 105 + ext4_fsblk_t goal; 106 + /* phys. block for the closest logical allocated block to the left */ 107 + ext4_fsblk_t pleft; 108 + /* phys. block for the closest logical allocated block to the right */ 109 + ext4_fsblk_t pright; 110 110 /* flags. see above EXT4_MB_HINT_* */ 111 111 unsigned int flags; 112 112 };