git: sys/vfs/hammer: Add sys/vfs/hammer/hammer_crc.h

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Tue Sep 6 06:35:22 PDT 2016


commit 8856c8bd6cbcd6c533c080374ed9303015471d17
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Mon Sep 5 23:34:53 2016 +0900

    sys/vfs/hammer: Add sys/vfs/hammer/hammer_crc.h
    
    HAMMER's CRC functions currently defined in sys/vfs/hammer/hammer.h
    could be exposed to userspace, since CRCs in various ondisk data
    structures are a part of HAMMER's ondisk format. In fact, userspace
    has a copy-pasted function from kernel code.
    
    This commit adds a new file sys/vfs/hammer/hammer_crc.h for both
    kernel and userspace. CRC functions are moved to this file.
    
    The reason for adding a new file instead of adding these inlined
    functions to hammer_{disk,btree,ioctl}.h is because crc32() requires
    explicit function prototype in userspace.
    (i.e. causes include order issues by userspace headers)
    
    Having function prototypes in hammer_{disk,btree}.h should also be
    avoided, because that brings in unnecessary dependencies that could
    be avoided for headers for ondisk format.

Summary of changes:
 sys/vfs/hammer/hammer.h     | 176 +---------------------------------
 sys/vfs/hammer/hammer_crc.h | 224 ++++++++++++++++++++++++++++++++++++++++++++
 usr.bin/fstat/hammer.c      |   1 +
 3 files changed, 226 insertions(+), 175 deletions(-)
 create mode 100644 sys/vfs/hammer/hammer_crc.h

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8856c8bd6cbcd6c533c080374ed9303015471d17


-- 
DragonFly BSD source repository


More information about the Commits mailing list