git: sys/vfs/hammer: Add HAMMER_ENCODE_UNDO()

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Thu Nov 3 08:48:18 PDT 2016


commit 459a6a40486fd2968e7232f532740844263a6bf3
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Nov 3 21:06:14 2016 +0900

    sys/vfs/hammer: Add HAMMER_ENCODE_UNDO()
    
    Add and use HAMMER_ENCODE_UNDO(offset) instead of
    HAMMER_ZONE_ENCODE(HAMMER_ZONE_UNDO_INDEX, offset),
    just like other ENCODE macros available for other zones.
    
    Since zone-3 doesn't take volume# by design (see L136 of
    sys/vfs/hammer/hammer_disk.h), HAMMER_ENCODE_UNDO() only
    takes offset, but not (volume#, offset). In other words,
    UNDO/REDO FIFO is in the root volume.
    
    sys/vfs/hammer/hammer_disk.h
     * zone 1 (z,v,o):	raw volume relative (offset 0 is the volume header)
     * zone 2 (z,v,o):	raw buffer relative (offset 0 is the first buffer)
     * zone 3 (z,o):	undo/redo fifo	- fixed zone-2 offset array in volume header
     * zone 4 (z,v,o):	freemap		- only real blockmap
     * zone 8 (z,v,o):	B-Tree		- actually zone-2 address
     * zone 9 (z,v,o):	meta		- actually zone-2 address
     * zone 10 (z,v,o):	large-data	- actually zone-2 address
     * zone 11 (z,v,o):	small-data	- actually zone-2 address

Summary of changes:
 sbin/hammer/cmd_blockmap.c      | 2 +-
 sbin/hammer/cmd_show.c          | 2 +-
 sbin/hammer/ondisk.c            | 7 +++----
 sys/vfs/hammer/hammer_disk.h    | 2 ++
 sys/vfs/hammer/hammer_recover.c | 9 ++++-----
 sys/vfs/hammer/hammer_redo.c    | 6 ++----
 sys/vfs/hammer/hammer_undo.c    | 8 +++-----
 7 files changed, 16 insertions(+), 20 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/459a6a40486fd2968e7232f532740844263a6bf3


-- 
DragonFly BSD source repository



More information about the Commits mailing list