ext4: Simplify flags in ext4_map_query_blocks()
authorRitesh Harjani (IBM) <ritesh.list@gmail.com>
Mon, 19 May 2025 18:19:29 +0000 (23:49 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 20 May 2025 18:21:00 +0000 (14:21 -0400)
Now that we have EXT4_EX_QUERY_FILTER mask, let's use that to simplify
the filtering of flags for passing to ext4_ext_map_blocks() in
ext4_map_query_blocks() function. This allows us to kill the query_flags
local variable which is not needed anymore.

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://patch.msgid.link/4ae735e83e6f43341e53e2d289e59156a8360134.1747677758.git.ritesh.list@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/inode.c

index c0489220d3c468cb8083d43af6d6ab461ed3d86e..18373de980f27aad43fae87b0b435cdea6c3c9ba 100644 (file)
@@ -762,7 +762,8 @@ enum {
  * pass while lookup/querying of on disk extent tree.
  */
 #define EXT4_EX_QUERY_FILTER   (EXT4_EX_NOCACHE | EXT4_EX_FORCE_CACHE |\
-                                EXT4_EX_NOFAIL)
+                                EXT4_EX_NOFAIL |\
+                                EXT4_GET_BLOCKS_QUERY_LAST_IN_LEAF)
 
 /*
  * Flags used by ext4_free_blocks
index d662ff486a823614cbe7e6d287da6eb9a281e02c..5ddb65d6f8fb71dfbd5840bd7032add3663c9370 100644 (file)
@@ -544,12 +544,10 @@ static int ext4_map_query_blocks(handle_t *handle, struct inode *inode,
        unsigned int status;
        int retval;
        unsigned int orig_mlen = map->m_len;
-       unsigned int query_flags = flags & EXT4_GET_BLOCKS_QUERY_LAST_IN_LEAF;
 
        flags &= EXT4_EX_QUERY_FILTER;
        if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
-               retval = ext4_ext_map_blocks(handle, inode, map,
-                                            flags | query_flags);
+               retval = ext4_ext_map_blocks(handle, inode, map, flags);
        else
                retval = ext4_ind_map_blocks(handle, inode, map, flags);