Submit #2782
closed[PATCH] hammer: fix terminology of "large block"
100%
Description
This cleanup patch changes terminology "large block" to "big block".
- Both "large block" and "big block" are widely used in hammer source from kernel to userspace, however these two refer to the same data structure which is a 8MB sized chunk within low level blockmapped storage layer.
- The original design document https://www.dragonflybsd.org/hammer/hammer.pdf uses big block for this data structure. Having two expressions in its implementation is confusing and makes grep difficult.
---
This patch basically renames HAMMER_LARGEBLOCK_XXX macro to HAMMER_BIGBLOCK_XXX plus some comments. Rest of the usages already use big block, but these macros were the remaining and frequently used ones.
- grep -rIi "big.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
185 - grep -rIi "large.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
155 - git am ~/0001-hammer-fix-terminology-of-large-block.patch
Applying: hammer: fix terminology of "large block" - grep -rIi "big.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
334 - grep -rIi "large.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
0
A piece of diff like below shows this change makes the code clear.
- bfree = ondisk->vol0_stat_freebigblocks * HAMMER_LARGEBLOCK_SIZE;
+ bfree = ondisk->vol0_stat_freebigblocks * HAMMER_BIGBLOCK_SIZE;
- totalbytes = (hvi->bigblocks << HAMMER_LARGEBLOCK_BITS);
- usedbytes = (usedbigblocks << HAMMER_LARGEBLOCK_BITS);
- rsvbytes = (hvi->rsvbigblocks << HAMMER_LARGEBLOCK_BITS);
+ totalbytes = (hvi->bigblocks << HAMMER_BIGBLOCK_BITS);
+ usedbytes = (usedbigblocks << HAMMER_BIGBLOCK_BITS);
+ rsvbytes = (hvi->rsvbigblocks << HAMMER_BIGBLOCK_BITS);
Files