]> git.baikalelectronics.ru Git - kernel.git/commit
simplify some logic in ext4_mb_normalize_request
authorEric Sandeen <sandeen@redhat.com>
Tue, 18 Aug 2009 03:55:24 +0000 (23:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 18 Aug 2009 03:55:24 +0000 (23:55 -0400)
commit829a3cde45c5d987033b57b685c20e21a924664e
treec7cab3a9c5f5bc53f0ba7df269a630b0018dac8a
parentc0c0abf26ee5037d0c1822b57c3806c9fc50f396
simplify some logic in ext4_mb_normalize_request

While reading through some of the mballoc code it seems that a couple
spots in the size normalization function could be streamlined.

The test for non-overlapping PAs can be or'd for the start & end
conditions, and the tests for adjacent PAs can be else-if'd -
it's essentially independently testing:

if (A + B <= C)
...
if (A > C)
...

These cannot both be true so it seems like the else-if might
be slightly more efficient and/or informative.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/mballoc.c