git: sys/vfs/hammer: Make hammer_delete_at_cursor() properly set *stat_bytes
Tomohiro Kusumi
tkusumi at crater.dragonflybsd.org
Sun Apr 26 08:39:19 PDT 2015
commit 03b6feead81b307f2f2e39220e169e7d7226c400
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Sun Apr 26 03:55:01 2015 +0900
sys/vfs/hammer: Make hammer_delete_at_cursor() properly set *stat_bytes
- This commit makes hammer_delete_at_cursor() set *stat_bytes arg.
*stat_bytes has been ignored although it was supposed to set bytes
physically deleted from the btree.
- hammer prune command expects this function to set above bytes and
print it after pruning, however it's always 0 because the function
ignores it.
- Note that the actual size freed from zone address space may differ
from *stat_bytes (or what the hammer prune command shows), because
hammer_blockmap_free() may round it up with its alignment size.
==========
example1 - with existing hammer
# hammer prune ./test
TID 000000010404e750 - 0000000104071090
TID 0000000104034060 - 000000010404e750
TID 0000000104019cb0 - 0000000104034060
TID 0000000000000001 - 0000000104019cb0
Prune /HAMMER/: 4 snapshots
Prune /HAMMER/: objspace 8000000000000000:0000 7fffffffffffffff:ffff pfs_id 0
Prune /HAMMER/: prune_min is 0d/00:00:00
Prune /HAMMER/ succeeded
Pruned 51/769595 records (10 directory entries) and 0 bytes
example2 - with this commit
# hammer prune ./test
TID 000000010404ea10 - 0000000104071390
TID 0000000104034360 - 000000010404ea10
TID 0000000104019fb0 - 0000000104034360
TID 0000000000000001 - 0000000104019fb0
Prune /HAMMER/: 4 snapshots
Prune /HAMMER/: objspace 8000000000000000:0000 7fffffffffffffff:ffff pfs_id 0
Prune /HAMMER/: prune_min is 0d/00:00:00
Prune /HAMMER/ succeeded
Pruned 51/769596 records (11 directory entries) and 6710 bytes
Summary of changes:
sys/vfs/hammer/hammer.h | 2 +-
sys/vfs/hammer/hammer_btree.c | 19 ++++++++++++++-----
sys/vfs/hammer/hammer_object.c | 12 +++++++++++-
sys/vfs/hammer/hammer_prune.c | 4 +++-
4 files changed, 29 insertions(+), 8 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/03b6feead81b307f2f2e39220e169e7d7226c400
--
DragonFly BSD source repository
More information about the Commits
mailing list