]> Pileus Git - ~andy/linux/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)
commitdc6982ff4db1f47da73b1967ef5302d6721e5b95
tree67c6f4187964e1430154a991e9f8c21e3cfd0b68
parent01a523eb51cb505a4bc1eaffeeccd2527d6ab619
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