Commit e927265225bf298d25b312758718cbc31510b175
Committed by
Tom Rini
1 parent
398d6fad92
Exists in
v2017.01-smarct4x
and in
25 other branches
ext4: Do not clear zalloc'ed buffers a second time
zero_buffer is never written, thus clearing it is pointless. journal_buffer is completely initialized by ext4fs_devread (or in case of failure, not used). Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Showing 1 changed file with 0 additions and 3 deletions Side-by-side Diff
fs/ext4/ext4_common.c
... | ... | @@ -929,7 +929,6 @@ |
929 | 929 | |
930 | 930 | if (le16_to_cpu(bgd[bg_idx].bg_flags) & EXT4_BG_BLOCK_UNINIT) { |
931 | 931 | uint16_t new_flags; |
932 | - memset(zero_buffer, '\0', fs->blksz); | |
933 | 932 | put_ext4((uint64_t)le32_to_cpu(bgd[bg_idx].block_id) * fs->blksz, |
934 | 933 | zero_buffer, fs->blksz); |
935 | 934 | memcpy(fs->blk_bmaps[bg_idx], zero_buffer, fs->blksz); |
... | ... | @@ -946,7 +945,6 @@ |
946 | 945 | |
947 | 946 | /* journal backup */ |
948 | 947 | if (prev_bg_bitmap_index != bg_idx) { |
949 | - memset(journal_buffer, '\0', fs->blksz); | |
950 | 948 | status = ext4fs_devread( |
951 | 949 | (lbaint_t)le32_to_cpu(bgd[bg_idx].block_id) |
952 | 950 | * fs->sect_perblk, |
... | ... | @@ -1040,7 +1038,6 @@ |
1040 | 1038 | ibmap_idx = fs->curr_inode_no / inodes_per_grp; |
1041 | 1039 | if (le16_to_cpu(bgd[ibmap_idx].bg_flags) & EXT4_BG_INODE_UNINIT) { |
1042 | 1040 | int new_flags; |
1043 | - memset(zero_buffer, '\0', fs->blksz); | |
1044 | 1041 | put_ext4((uint64_t)le32_to_cpu(bgd[ibmap_idx].inode_id) * fs->blksz, |
1045 | 1042 | zero_buffer, fs->blksz); |
1046 | 1043 | new_flags = le16_to_cpu(bgd[ibmap_idx].bg_flags) & ~EXT4_BG_INODE_UNINIT; |