From 2a796d84af42403ea149d35ee5578741c5470474 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 1 Apr 2016 12:57:11 +0200 Subject: 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 --- cmds-inspect-tree-stats.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cmds-inspect-tree-stats.c') diff --git a/cmds-inspect-tree-stats.c b/cmds-inspect-tree-stats.c index 792ccaa8..4e1a28ea 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); -- cgit v1.2.3