Skip to content

Commit 618320d

Browse files
riteshharjanitytso
authored andcommitted
ext4: Simplify flags in ext4_map_query_blocks()
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>
1 parent 9597376 commit 618320d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

fs/ext4/ext4.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,8 @@ enum {
762762
* pass while lookup/querying of on disk extent tree.
763763
*/
764764
#define EXT4_EX_QUERY_FILTER (EXT4_EX_NOCACHE | EXT4_EX_FORCE_CACHE |\
765-
EXT4_EX_NOFAIL)
765+
EXT4_EX_NOFAIL |\
766+
EXT4_GET_BLOCKS_QUERY_LAST_IN_LEAF)
766767

767768
/*
768769
* Flags used by ext4_free_blocks

fs/ext4/inode.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,10 @@ static int ext4_map_query_blocks(handle_t *handle, struct inode *inode,
544544
unsigned int status;
545545
int retval;
546546
unsigned int orig_mlen = map->m_len;
547-
unsigned int query_flags = flags & EXT4_GET_BLOCKS_QUERY_LAST_IN_LEAF;
548547

549548
flags &= EXT4_EX_QUERY_FILTER;
550549
if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
551-
retval = ext4_ext_map_blocks(handle, inode, map,
552-
flags | query_flags);
550+
retval = ext4_ext_map_blocks(handle, inode, map, flags);
553551
else
554552
retval = ext4_ind_map_blocks(handle, inode, map, flags);
555553

0 commit comments

Comments
 (0)