Thread (4 messages) 4 messages, 4 authors, 2011-06-28

Re: [PATCH v2] ext4: avoid redundant cache finding if flags not cantian PUNCH_OUT

From: Steven Liu <hidden>
Date: 2011-06-27 13:45:26

Hi Robin Dong

     Why don't modify this line?
   if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) {
    if(!(flags & EXT4_GET_BLOCKS_CREATE))


2011/6/27 Robin Dong [off-list ref]:
quoted hunk ↗ jump to hunk
In old code, ext4 will find extent in cache first even flags does
not contian PUNCH_OUT, that may waste some time.

Signed-off-by: Robin Dong <redacted>
Reviewed-by: Lukas Czerner <redacted>
---
 fs/ext4/extents.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index eb63c7b..fed2633 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3358,8 +3358,8 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
       trace_ext4_ext_map_blocks_enter(inode, map->m_lblk, map->m_len, flags);

       /* check in cache */
-       if (ext4_ext_in_cache(inode, map->m_lblk, &newex) &&
-               ((flags & EXT4_GET_BLOCKS_PUNCH_OUT_EXT) == 0)) {
+       if (!(flags & EXT4_GET_BLOCKS_PUNCH_OUT_EXT) &&
+               ext4_ext_in_cache(inode, map->m_lblk, &newex)) {
               if (!newex.ee_start_lo && !newex.ee_start_hi) {
                       if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) {
                               /*
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Best Regards
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help