Project

General

Profile

Actions

Submit #2782

closed

[PATCH] hammer: fix terminology of "large block"

Added by tkusumi almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/31/2015
Due date:
% Done:

100%

Estimated time:

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.

  1. grep -rIi "big.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
    185
  2. grep -rIi "large.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
    155
  3. git am ~/0001-hammer-fix-terminology-of-large-block.patch
    Applying: hammer: fix terminology of "large block"
  4. grep -rIi "big.\?block" sys/vfs/hammer sbin/hammer sbin/newfs_hammer sbin/mount_hammer lib/libhammer usr.bin/undo | wc -l
    334
  5. 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

Actions #1

Updated by tkusumi almost 10 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF