ext4: remove 'needed' in trace_ext4_discard_preallocations
authorKemeng Shi <shikemeng@huaweicloud.com>
Fri, 5 Jan 2024 09:21:02 +0000 (17:21 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 18 Jan 2024 15:52:45 +0000 (10:52 -0500)
As 'needed' to trace_ext4_discard_preallocations is always 0 which
is meaningless. Just remove it.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Suggested-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240105092102.496631-10-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c
include/trace/events/ext4.h

index f3da7db2beee5caa08e9e7f52e31e94b878b1f28..e4f7cf9d89c45a881d6c403fd50fcc499db0b708 100644 (file)
@@ -5510,9 +5510,8 @@ void ext4_discard_preallocations(struct inode *inode)
        struct rb_node *iter;
        int err;
 
-       if (!S_ISREG(inode->i_mode)) {
+       if (!S_ISREG(inode->i_mode))
                return;
-       }
 
        if (EXT4_SB(sb)->s_mount_state & EXT4_FC_REPLAY)
                return;
@@ -5520,7 +5519,7 @@ void ext4_discard_preallocations(struct inode *inode)
        mb_debug(sb, "discard preallocation for inode %lu\n",
                 inode->i_ino);
        trace_ext4_discard_preallocations(inode,
-                       atomic_read(&ei->i_prealloc_active), 0);
+                       atomic_read(&ei->i_prealloc_active));
 
 repeat:
        /* first, collect all pa's in the inode */
index 65029dfb92fbc3162c30d0a85a6805afa3ab335e..a697f4b77162dd79c45c5cdb25db63332818fcc7 100644 (file)
@@ -772,15 +772,14 @@ TRACE_EVENT(ext4_mb_release_group_pa,
 );
 
 TRACE_EVENT(ext4_discard_preallocations,
-       TP_PROTO(struct inode *inode, unsigned int len, unsigned int needed),
+       TP_PROTO(struct inode *inode, unsigned int len),
 
-       TP_ARGS(inode, len, needed),
+       TP_ARGS(inode, len),
 
        TP_STRUCT__entry(
                __field(        dev_t,          dev             )
                __field(        ino_t,          ino             )
                __field(        unsigned int,   len             )
-               __field(        unsigned int,   needed          )
 
        ),
 
@@ -788,13 +787,11 @@ TRACE_EVENT(ext4_discard_preallocations,
                __entry->dev    = inode->i_sb->s_dev;
                __entry->ino    = inode->i_ino;
                __entry->len    = len;
-               __entry->needed = needed;
        ),
 
-       TP_printk("dev %d,%d ino %lu len: %u needed %u",
+       TP_printk("dev %d,%d ino %lu len: %u",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
-                 (unsigned long) __entry->ino, __entry->len,
-                 __entry->needed)
+                 (unsigned long) __entry->ino, __entry->len)
 );
 
 TRACE_EVENT(ext4_mb_discard_preallocations,