git: sys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sun Dec 6 09:08:33 PST 2015


commit 20cf2291b7b758fecda6e4e8f0a11effbc91c226
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sun Dec 6 19:36:05 2015 +0900

    sys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros
    
    These macros hide 16 bits shift and cast to int/uint32_t
    that are necessary on localization to/from PFS id conversion.
    
    Some code are better without details being hidden by macros,
    but this seems to be more readable with x_to_y macros that
    hide bunch of >>16, <<16, and casts.
    
    (No diff in binary on x86_64/gcc5)

Summary of changes:
 sbin/hammer/cmd_recover.c         |  2 +-
 sys/vfs/hammer/hammer_btree.h     |  5 +++++
 sys/vfs/hammer/hammer_mirror.c    |  4 ++--
 sys/vfs/hammer/hammer_pfs.c       | 18 +++++++++---------
 sys/vfs/hammer/hammer_rebalance.c |  2 +-
 sys/vfs/hammer/hammer_reblock.c   |  2 +-
 sys/vfs/hammer/hammer_subs.c      |  2 +-
 sys/vfs/hammer/hammer_vfsops.c    |  4 ++--
 sys/vfs/hammer/hammer_vnops.c     |  6 +++---
 9 files changed, 25 insertions(+), 20 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/20cf2291b7b758fecda6e4e8f0a11effbc91c226


-- 
DragonFly BSD source repository


More information about the Commits mailing list