Commit 66a57684 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Kill fs_usage_online



More dead code deletion.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent fe5eddc0
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -37,16 +37,6 @@ static u64 reserve_factor(u64 r)
	return r + (round_up(r, (1 << RESERVE_FACTOR)) >> RESERVE_FACTOR);
}

u64 bch2_fs_sectors_used(struct bch_fs *c, struct bch_fs_usage_online *fs_usage)
{
	return min(fs_usage->u.b.hidden +
		   fs_usage->u.b.btree +
		   fs_usage->u.b.data +
		   reserve_factor(fs_usage->u.b.reserved +
				  fs_usage->online_reserved),
		   c->capacity);
}

static struct bch_fs_usage_short
__bch2_fs_usage_read_short(struct bch_fs *c)
{
+0 −12
Original line number Diff line number Diff line
@@ -283,23 +283,11 @@ static inline unsigned fs_usage_u64s(struct bch_fs *c)
	return __fs_usage_u64s(READ_ONCE(c->replicas.nr));
}

static inline unsigned __fs_usage_online_u64s(unsigned nr_replicas)
{
	return sizeof(struct bch_fs_usage_online) / sizeof(u64) + nr_replicas;
}

static inline unsigned fs_usage_online_u64s(struct bch_fs *c)
{
	return __fs_usage_online_u64s(READ_ONCE(c->replicas.nr));
}

static inline unsigned dev_usage_u64s(void)
{
	return sizeof(struct bch_dev_usage) / sizeof(u64);
}

u64 bch2_fs_sectors_used(struct bch_fs *, struct bch_fs_usage_online *);

struct bch_fs_usage_short
bch2_fs_usage_read_short(struct bch_fs *);

+0 −5
Original line number Diff line number Diff line
@@ -64,11 +64,6 @@ struct bch_fs_usage {
	u64			replicas[];
};

struct bch_fs_usage_online {
	u64			online_reserved;
	struct bch_fs_usage	u;
};

struct bch_fs_usage_short {
	u64			capacity;
	u64			used;