summaryrefslogtreecommitdiff
path: root/cmds-inspect-tree-stats.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-04-01 12:57:11 +0200
committerDavid Sterba <dsterba@suse.com>2016-05-02 14:40:18 +0200
commit2a796d84af42403ea149d35ee5578741c5470474 (patch)
tree92f7ee711ce0bdad0f563a638305985230c08495 /cmds-inspect-tree-stats.c
parentb005ca024990569d2de459485682158633937928 (diff)
btrfs-progs: replace leafsize with nodesize
Nodesize is used in kernel, the values are always equal. We have to keep leafsize in headers, similarly the tree setting functions still take and set leafsize, but it's effectively a no-op. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-inspect-tree-stats.c')
-rw-r--r--cmds-inspect-tree-stats.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmds-inspect-tree-stats.c b/cmds-inspect-tree-stats.c
index 792ccaa..4e1a28e 100644
--- a/cmds-inspect-tree-stats.c
+++ b/cmds-inspect-tree-stats.c
@@ -104,7 +104,7 @@ static int walk_leaf(struct btrfs_root *root, struct btrfs_path *path,
struct btrfs_key found_key;
int i;
- stat->total_bytes += root->leafsize;
+ stat->total_bytes += root->nodesize;
stat->total_leaves++;
if (!find_inline)
@@ -137,7 +137,7 @@ static int walk_nodes(struct btrfs_root *root, struct btrfs_path *path,
{
struct extent_buffer *b = path->nodes[level];
u64 last_block;
- u64 cluster_size = root->leafsize;
+ u64 cluster_size = root->nodesize;
int i;
int ret = 0;
@@ -166,9 +166,9 @@ static int walk_nodes(struct btrfs_root *root, struct btrfs_path *path,
find_inline);
else
ret = walk_leaf(root, path, stat, find_inline);
- if (last_block + root->leafsize != cur_blocknr) {
+ if (last_block + root->nodesize != cur_blocknr) {
u64 distance = calc_distance(last_block +
- root->leafsize,
+ root->nodesize,
cur_blocknr);
stat->total_seeks++;
stat->total_seek_len += distance;
@@ -184,7 +184,7 @@ static int walk_nodes(struct btrfs_root *root, struct btrfs_path *path,
stat->forward_seeks++;
else
stat->backward_seeks++;
- if (cluster_size != root->leafsize) {
+ if (cluster_size != root->nodesize) {
stat->total_cluster_size += cluster_size;
stat->total_clusters++;
if (cluster_size < stat->min_cluster_size)
@@ -192,9 +192,9 @@ static int walk_nodes(struct btrfs_root *root, struct btrfs_path *path,
if (cluster_size > stat->max_cluster_size)
stat->max_cluster_size = cluster_size;
}
- cluster_size = root->leafsize;
+ cluster_size = root->nodesize;
} else {
- cluster_size += root->leafsize;
+ cluster_size += root->nodesize;
}
last_block = cur_blocknr;
if (cur_blocknr < stat->lowest_bytenr)
@@ -337,7 +337,7 @@ static int calc_root_size(struct btrfs_root *tree_root, struct btrfs_key *key,
stat.lowest_bytenr = btrfs_header_bytenr(root->node);
stat.highest_bytenr = stat.lowest_bytenr;
stat.min_cluster_size = (u64)-1;
- stat.max_cluster_size = root->leafsize;
+ stat.max_cluster_size = root->nodesize;
path->nodes[level] = root->node;
if (gettimeofday(&start, NULL)) {
fprintf(stderr, "Error getting time: %d\n", errno);