[DragonFlyBSD - Submit #2782] (Closed) [PATCH] hammer: fix terminology of "large block"
bugtracker-admin at leaf.dragonflybsd.org
bugtracker-admin at leaf.dragonflybsd.org
Sat Feb 7 04:59:09 PST 2015
Issue #2782 has been updated by tkusumi.
Status changed from New to Closed
% Done changed from 0 to 100
Applied in changeset commit:e04ee2deffe511013c324e593719d66829589284.
----------------------------------------
Submit #2782: [PATCH] hammer: fix terminology of "large block"
http://bugs.dragonflybsd.org/issues/2782#change-12588
* Author: tkusumi
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
----------------------------------------
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--------------------------------
0001-hammer-fix-terminology-of-large-block.patch (42.2 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Submit
mailing list