]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: refactor code to read directory blocks into ext4_read_dirblock()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 15 Feb 2013 04:59:26 +0000 (23:59 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 15 Feb 2013 04:59:26 +0000 (23:59 -0500)
commitc6e1a29dde2c0d2c6a146c6fbca18cc822f056d0
tree5f663d9e974460de2e620b01eb6d4a0c5c69360e
parent05f98f427b4d17a0be6815491f58e7e91789b5b5
ext4: refactor code to read directory blocks into ext4_read_dirblock()

The code to read in directory blocks and verify their metadata
checksums was replicated in ten different places across
fs/ext4/namei.c, and the code was buggy in subtle ways in a number of
those replicated sites.  In some cases, ext4_error() was called with a
training newline.  In others, in particularly in empty_dir(), it was
possible to call ext4_dirent_csum_verify() on an index block, which
would trigger false warnings requesting the system adminsitrator to
run e2fsck.

By refactoring the code, we make the code more readable, as well as
shrinking the compiled object file by over 700 bytes and 50 lines of
code.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/namei.c