git: sys/vfs/hammer: Don't repeat layer1 blockmap check for no reason

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Aug 8 13:47:19 PDT 2015


commit 0871ec5cd713b161a324e9a8e5f22cabe24ffaf7
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Wed Aug 5 05:55:12 2015 +0900

    sys/vfs/hammer: Don't repeat layer1 blockmap check for no reason
    
    When blockmap allocation/reservation finds no more space in
    the current layer1, it jumps up to the next layer1 offset,
    however this is meaningless when the next one isn't physically
    available (beyond the end of the volume).
    
    It should just jump up to the first layer1 of the next volume.
    Otherwise it could repeat "goto again;" for max 1024 times or
    somewhere near that unless the volume size is some PB scale.
    Repetition of all the sanity checks between "again:" and here
    are irrelevant when the layer1 isn't mapped to valid area.
    
    This commit checks for the end of the volume when it finds no
    more space in the current layer1, but not every time in the
    main path of blockmap allocation/reservation code so the
    additional check won't be overhead.

Summary of changes:
 sys/vfs/hammer/hammer_blockmap.c | 45 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0871ec5cd713b161a324e9a8e5f22cabe24ffaf7


-- 
DragonFly BSD source repository



More information about the Commits mailing list