ext4: remove unused metadata accounting variables
authorEric Whitney <enwlinux@gmail.com>
Mon, 31 Jul 2017 02:30:11 +0000 (22:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 31 Jul 2017 02:30:11 +0000 (22:30 -0400)
Two variables in ext4_inode_info, i_reserved_meta_blocks and
i_allocated_meta_blocks, are unused.  Removing them saves a little
memory per in-memory inode and cleans up clutter in several tracepoints.
Adjust tracepoint output from ext4_alloc_da_blocks() for consistency
and fix a typo and whitespace near these changes.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
fs/ext4/ext4.h
fs/ext4/super.c
include/trace/events/ext4.h

index 9ebde0cd632e77b69fecd7800ed196e67b059507..dcbcd9d444d1ee17a64cc83653de45254a0c11d9 100644 (file)
@@ -961,7 +961,7 @@ struct ext4_inode_info {
        /*
         * i_block_group is the number of the block group which contains
         * this file's inode.  Constant across the lifetime of the inode,
-        * it is ued for making block allocation decisions - we try to
+        * it is used for making block allocation decisions - we try to
         * place a file's data blocks near its inode block, and new inodes
         * near to their parent directory's inode.
         */
@@ -1049,10 +1049,8 @@ struct ext4_inode_info {
        ext4_group_t    i_last_alloc_group;
 
        /* allocation reservation info for delalloc */
-       /* In case of bigalloc, these refer to clusters rather than blocks */
+       /* In case of bigalloc, this refer to clusters rather than blocks */
        unsigned int i_reserved_data_blocks;
-       unsigned int i_reserved_meta_blocks;
-       unsigned int i_allocated_meta_blocks;
        ext4_lblk_t i_da_metadata_calc_last_lblock;
        int i_da_metadata_calc_len;
 
index 0886fe82e9c49202311922680a33723c513c9983..d61a70e2193a012d48f5c56140a416abb2280b68 100644 (file)
@@ -978,8 +978,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
        ei->i_es_shk_nr = 0;
        ei->i_es_shrink_lblk = 0;
        ei->i_reserved_data_blocks = 0;
-       ei->i_reserved_meta_blocks = 0;
-       ei->i_allocated_meta_blocks = 0;
        ei->i_da_metadata_calc_len = 0;
        ei->i_da_metadata_calc_last_lblock = 0;
        spin_lock_init(&(ei->i_block_reservation_lock));
index dfae175ddebc2340c68e9145d588f57f2f45ebce..9c3bc3883d2fac1fbd4683d9eb4efbd74282f5c6 100644 (file)
@@ -937,21 +937,19 @@ TRACE_EVENT(ext4_alloc_da_blocks,
        TP_STRUCT__entry(
                __field(        dev_t,  dev                     )
                __field(        ino_t,  ino                     )
-               __field( unsigned int,  data_blocks     )
-               __field( unsigned int,  meta_blocks     )
+               __field( unsigned int,  data_blocks             )
        ),
 
        TP_fast_assign(
                __entry->dev    = inode->i_sb->s_dev;
                __entry->ino    = inode->i_ino;
                __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
-               __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
        ),
 
-       TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
+       TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  (unsigned long) __entry->ino,
-                 __entry->data_blocks, __entry->meta_blocks)
+                 __entry->data_blocks)
 );
 
 TRACE_EVENT(ext4_mballoc_alloc,
@@ -1153,8 +1151,6 @@ TRACE_EVENT(ext4_da_update_reserve_space,
                __field(        __u64,  i_blocks                )
                __field(        int,    used_blocks             )
                __field(        int,    reserved_data_blocks    )
-               __field(        int,    reserved_meta_blocks    )
-               __field(        int,    allocated_meta_blocks   )
                __field(        int,    quota_claim             )
                __field(        __u16,  mode                    )
        ),
@@ -1166,22 +1162,16 @@ TRACE_EVENT(ext4_da_update_reserve_space,
                __entry->used_blocks = used_blocks;
                __entry->reserved_data_blocks =
                                EXT4_I(inode)->i_reserved_data_blocks;
-               __entry->reserved_meta_blocks =
-                               EXT4_I(inode)->i_reserved_meta_blocks;
-               __entry->allocated_meta_blocks =
-                               EXT4_I(inode)->i_allocated_meta_blocks;
                __entry->quota_claim = quota_claim;
                __entry->mode   = inode->i_mode;
        ),
 
        TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
-                 "reserved_data_blocks %d reserved_meta_blocks %d "
-                 "allocated_meta_blocks %d quota_claim %d",
+                 "reserved_data_blocks %d quota_claim %d",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  (unsigned long) __entry->ino,
                  __entry->mode, __entry->i_blocks,
                  __entry->used_blocks, __entry->reserved_data_blocks,
-                 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
                  __entry->quota_claim)
 );
 
@@ -1195,7 +1185,6 @@ TRACE_EVENT(ext4_da_reserve_space,
                __field(        ino_t,  ino                     )
                __field(        __u64,  i_blocks                )
                __field(        int,    reserved_data_blocks    )
-               __field(        int,    reserved_meta_blocks    )
                __field(        __u16,  mode                    )
        ),
 
@@ -1204,17 +1193,15 @@ TRACE_EVENT(ext4_da_reserve_space,
                __entry->ino    = inode->i_ino;
                __entry->i_blocks = inode->i_blocks;
                __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
-               __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
                __entry->mode   = inode->i_mode;
        ),
 
        TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
-                 "reserved_data_blocks %d reserved_meta_blocks %d",
+                 "reserved_data_blocks %d",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  (unsigned long) __entry->ino,
                  __entry->mode, __entry->i_blocks,
-                 __entry->reserved_data_blocks,
-                 __entry->reserved_meta_blocks)
+                 __entry->reserved_data_blocks)
 );
 
 TRACE_EVENT(ext4_da_release_space,
@@ -1228,8 +1215,6 @@ TRACE_EVENT(ext4_da_release_space,
                __field(        __u64,  i_blocks                )
                __field(        int,    freed_blocks            )
                __field(        int,    reserved_data_blocks    )
-               __field(        int,    reserved_meta_blocks    )
-               __field(        int,    allocated_meta_blocks   )
                __field(        __u16,  mode                    )
        ),
 
@@ -1239,19 +1224,15 @@ TRACE_EVENT(ext4_da_release_space,
                __entry->i_blocks = inode->i_blocks;
                __entry->freed_blocks = freed_blocks;
                __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
-               __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
-               __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
                __entry->mode   = inode->i_mode;
        ),
 
        TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
-                 "reserved_data_blocks %d reserved_meta_blocks %d "
-                 "allocated_meta_blocks %d",
+                 "reserved_data_blocks %d",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  (unsigned long) __entry->ino,
                  __entry->mode, __entry->i_blocks,
-                 __entry->freed_blocks, __entry->reserved_data_blocks,
-                 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
+                 __entry->freed_blocks, __entry->reserved_data_blocks)
 );
 
 DECLARE_EVENT_CLASS(ext4__bitmap_load,