git: sbin/hammer: Optimize freemap initialization

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


commit e39a061e84808edf2a4d2bd9f2cf202228ba69de
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sat Aug 8 01:03:37 2015 +0900

    sbin/hammer: Optimize freemap initialization
    
    Bring in the way hammer_iterate_l1l2_entries() initializes
    layer1/2 to initialize_freemap(). The layer1 crc needs to
    be updated only once in every 2^19 layer2 entries. No need
    to do it for every layer2 entry as they'll be overwritten
    except for the one after the last layer2 (2^19th layer2 entry)
    within layer1.
    
    Also having nested loops here for layer1 and layer2 seems
    to better explain the concept of hammer's blockmap.

Summary of changes:
 sbin/hammer/ondisk.c | 67 +++++++++++++++++++++++++++++-----------------------
 1 file changed, 38 insertions(+), 29 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e39a061e84808edf2a4d2bd9f2cf202228ba69de


-- 
DragonFly BSD source repository



More information about the Commits mailing list