Skip to content

Commit 437cc60

Browse files
morbidrsakdave
authored andcommitted
btrfs: remove zoned statistics from sysfs
Remove the newly introduced zoned statistics from sysfs, as sysfs can only show a single page this will truncate the output on a busy filesystem. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent a11224a commit 437cc60

1 file changed

Lines changed: 0 additions & 52 deletions

File tree

fs/btrfs/sysfs.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "misc.h"
2727
#include "fs.h"
2828
#include "accessors.h"
29-
#include "zoned.h"
3029

3130
/*
3231
* Structure name Path
@@ -1189,56 +1188,6 @@ static ssize_t btrfs_commit_stats_store(struct kobject *kobj,
11891188
}
11901189
BTRFS_ATTR_RW(, commit_stats, btrfs_commit_stats_show, btrfs_commit_stats_store);
11911190

1192-
static ssize_t btrfs_zoned_stats_show(struct kobject *kobj,
1193-
struct kobj_attribute *a, char *buf)
1194-
{
1195-
struct btrfs_fs_info *fs_info = to_fs_info(kobj);
1196-
struct btrfs_block_group *bg;
1197-
size_t ret = 0;
1198-
1199-
1200-
if (!btrfs_is_zoned(fs_info))
1201-
return ret;
1202-
1203-
spin_lock(&fs_info->zone_active_bgs_lock);
1204-
ret += sysfs_emit_at(buf, ret, "active block-groups: %zu\n",
1205-
list_count_nodes(&fs_info->zone_active_bgs));
1206-
spin_unlock(&fs_info->zone_active_bgs_lock);
1207-
1208-
mutex_lock(&fs_info->reclaim_bgs_lock);
1209-
spin_lock(&fs_info->unused_bgs_lock);
1210-
ret += sysfs_emit_at(buf, ret, "\treclaimable: %zu\n",
1211-
list_count_nodes(&fs_info->reclaim_bgs));
1212-
ret += sysfs_emit_at(buf, ret, "\tunused: %zu\n",
1213-
list_count_nodes(&fs_info->unused_bgs));
1214-
spin_unlock(&fs_info->unused_bgs_lock);
1215-
mutex_unlock(&fs_info->reclaim_bgs_lock);
1216-
1217-
ret += sysfs_emit_at(buf, ret, "\tneed reclaim: %s\n",
1218-
str_true_false(btrfs_zoned_should_reclaim(fs_info)));
1219-
1220-
if (fs_info->data_reloc_bg)
1221-
ret += sysfs_emit_at(buf, ret,
1222-
"data relocation block-group: %llu\n",
1223-
fs_info->data_reloc_bg);
1224-
if (fs_info->treelog_bg)
1225-
ret += sysfs_emit_at(buf, ret,
1226-
"tree-log block-group: %llu\n",
1227-
fs_info->treelog_bg);
1228-
1229-
spin_lock(&fs_info->zone_active_bgs_lock);
1230-
ret += sysfs_emit_at(buf, ret, "active zones:\n");
1231-
list_for_each_entry(bg, &fs_info->zone_active_bgs, active_bg_list) {
1232-
ret += sysfs_emit_at(buf, ret,
1233-
"\tstart: %llu, wp: %llu used: %llu, reserved: %llu, unusable: %llu\n",
1234-
bg->start, bg->alloc_offset, bg->used,
1235-
bg->reserved, bg->zone_unusable);
1236-
}
1237-
spin_unlock(&fs_info->zone_active_bgs_lock);
1238-
return ret;
1239-
}
1240-
BTRFS_ATTR(, zoned_stats, btrfs_zoned_stats_show);
1241-
12421191
static ssize_t btrfs_clone_alignment_show(struct kobject *kobj,
12431192
struct kobj_attribute *a, char *buf)
12441193
{
@@ -1651,7 +1600,6 @@ static const struct attribute *btrfs_attrs[] = {
16511600
BTRFS_ATTR_PTR(, bg_reclaim_threshold),
16521601
BTRFS_ATTR_PTR(, commit_stats),
16531602
BTRFS_ATTR_PTR(, temp_fsid),
1654-
BTRFS_ATTR_PTR(, zoned_stats),
16551603
#ifdef CONFIG_BTRFS_EXPERIMENTAL
16561604
BTRFS_ATTR_PTR(, offload_csum),
16571605
#endif

0 commit comments

Comments
 (0)