aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-01-14 13:52:13 -0500
committerChris Mason <clm@fb.com>2015-01-21 21:02:04 -0500
commit9ee49a047dc53fd21808cbb7f3b6a3345463e834 (patch)
tree98710aa584c84501c00ecf2227138ff4f44d5396 /fs/btrfs/inode.c
parent5efa0490cc94aee06cd8d282683e22a8ce0a0026 (diff)
btrfs: switch extent_state state to unsigned
Currently there's a 4B hole in the structure between refs and state and there are only 16 bits used so we can make it unsigned. This will get a better packing and may save some stack space for local variables. The size of extent_state gets reduced by 8B and there are usually a lot of slab objects. struct extent_state { u64 start; /* 0 8 */ u64 end; /* 8 8 */ struct rb_node rb_node; /* 16 24 */ wait_queue_head_t wq; /* 40 24 */ /* --- cacheline 1 boundary (64 bytes) --- */ atomic_t refs; /* 64 4 */ /* XXX 4 bytes hole, try to pack */ long unsigned int state; /* 72 8 */ u64 private; /* 80 8 */ /* size: 88, cachelines: 2, members: 7 */ /* sum members: 84, holes: 1, sum holes: 4 */ /* last cacheline: 24 bytes */ }; Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5e529208ffea..220f0c3f2df6 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1604,7 +1604,7 @@ static void btrfs_del_delalloc_inode(struct btrfs_root *root,
1604 * have pending delalloc work to be done. 1604 * have pending delalloc work to be done.
1605 */ 1605 */
1606static void btrfs_set_bit_hook(struct inode *inode, 1606static void btrfs_set_bit_hook(struct inode *inode,
1607 struct extent_state *state, unsigned long *bits) 1607 struct extent_state *state, unsigned *bits)
1608{ 1608{
1609 1609
1610 if ((*bits & EXTENT_DEFRAG) && !(*bits & EXTENT_DELALLOC)) 1610 if ((*bits & EXTENT_DEFRAG) && !(*bits & EXTENT_DELALLOC))
@@ -1645,7 +1645,7 @@ static void btrfs_set_bit_hook(struct inode *inode,
1645 */ 1645 */
1646static void btrfs_clear_bit_hook(struct inode *inode, 1646static void btrfs_clear_bit_hook(struct inode *inode,
1647 struct extent_state *state, 1647 struct extent_state *state,
1648 unsigned long *bits) 1648 unsigned *bits)
1649{ 1649{
1650 u64 len = state->end + 1 - state->start; 1650 u64 len = state->end + 1 - state->start;
1651 1651