Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp649876rbb; Sat, 24 Feb 2024 18:40:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUf/8aesBVVah2jaqiyOhkjdkKLR4zM5g2gkLDgy5qxYJmxnz38tb5/o+LMeqZtyCOF+sq8WIsNi/b7+sZDkUoKqzpiuMsy9jXvNIH8GA== X-Google-Smtp-Source: AGHT+IEgXKy/w8IWSbSOdudIV+nkVShPlOwFyf7hb4oKYb07ml5UHboVrMs3wQv6MXhHP/6YwRs2 X-Received: by 2002:a05:6512:10c7:b0:512:f306:414e with SMTP id k7-20020a05651210c700b00512f306414emr1792712lfg.63.1708828858490; Sat, 24 Feb 2024 18:40:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708828858; cv=pass; d=google.com; s=arc-20160816; b=L7tFAvKMZRnaogElTxaablgWFMXd2loWSjz7zInx7DjuZ9ZMAyjPgqKNSv4e/n1hgz iAf1An1OzZyLp+BN5lRuISCnngVE15/S0NR5v2VOI2mqNKDhcXP8jdoESz/cy/NKQDCk Oj+v0SmeUvYuR/XpMuLtXbZ5o0JhFGcQC7L9OzqHqwCQ+z7mK0lDcPV9BL9iXwZAMmAI yJrB9QAYMZp65FQ67fHEIdFGm/VVHE9AAjc5K5CFGI7RRa38IRA2y1T4vMhhe2JuGxBT D4lBkFDPOkp34UGIcAMi7ONN+O5VMEO+0sR5q+rBvwdAW8ZexGgaxn2mbVUKa28IE9XA /2Tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+XxTvZ+w+R//l1/8+X2sA3MHcm6KcV5Vz+RJqp7UJC8=; fh=cHCDtKbuQPXHd8MTSa2UUr5dC1B5BRlSqWWb9m+1Nbw=; b=Xzct+zp9/CFHdCOVlGfkVahy3jc06sDnR7uwZIF38DXAvSRqsAf7hPONv3DBKYG7Rq 8QRFjCnTqvsY0EgFHYTDygubDBAZbz4MU+IoN4V4WTOztCbk0GRLc5QxoF/6guOnp68i cmlJHswLacI8ZsLl77TG2Wk35Mq6hk5z9av23Iqpx5hcZg7QJvtQwrHgtGkcm68tij0d c21Dg+TVQLOd3mFMITY4WefQtnI1XLP6+m/jyH2/NpdD96XlJNXk7crxV5rjuQSWXVXA 2Teho78jX/fBaxQE6xmR5uIhUN1BNFhRARgdMUAEYGyI88iaPh26gBidam4xuMjdzryh XqJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=iRFP2ifW; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-79941-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79941-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cd21-20020a170906b35500b00a3e9671aafasi954664ejb.259.2024.02.24.18.40.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 18:40:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79941-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=iRFP2ifW; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-79941-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79941-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0B33F1F21802 for ; Sun, 25 Feb 2024 02:40:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D5DE17581; Sun, 25 Feb 2024 02:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="iRFP2ifW" Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6D3A134A9 for ; Sun, 25 Feb 2024 02:38:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708828728; cv=none; b=Jvl+UMWEuCNHFbqv37zbRwxPXaQKG0jCHM4rnAoJlyobW0lC2+NmjhOgj7tSs7NExL9VWtTVnrhVmnuUTyxPZXmoSGBMW3fVP3WqQqE5y9bGqMmqlcsJilR05CElZbWKK3xhwy2+wvCQ9AoG53PUcmOROp6JPPRj8xF9o4d/Bdw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708828728; c=relaxed/simple; bh=DkSMbHGXD7jvgfcyN0h8VxzJwADDueaJ+dPGY9kVlEo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gmCkgsI+uOOFQThSN3hjB20YfJppfX/Gw8zGDVQ89te7cvzM2j8hsv0Q/mMMM6FZFLFe6gEs45DvZtCNZg272btDwnfy6xot1axIZDOA3EnIDoHLt6ChMxSJGor0kgfOVUZy69zgs5usEAk+qSowbUAbsckstwhgKKpHtUHp2Vo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=iRFP2ifW; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708828725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+XxTvZ+w+R//l1/8+X2sA3MHcm6KcV5Vz+RJqp7UJC8=; b=iRFP2ifW2GoApeZJ1zZOyXzDJTb4hPXB2Bn1jIWeMOr8zpgWXdwf76Iuwyr4tE5SoWJgWj TBRmLrUg3wHfNe1Vd4J6EHDyAKHn7yD/44qN6d2rr0Ro2rh64NN4lRTfppGIturZovj2V5 n0Fog7fhMrzvJqNAvbB89DYQBytzCcQ= From: Kent Overstreet To: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Kent Overstreet , djwong@kernel.org, bfoster@redhat.com Subject: [PATCH 12/21] bcachefs: Kill fs_usage_online Date: Sat, 24 Feb 2024 21:38:14 -0500 Message-ID: <20240225023826.2413565-13-kent.overstreet@linux.dev> In-Reply-To: <20240225023826.2413565-1-kent.overstreet@linux.dev> References: <20240225023826.2413565-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT More dead code deletion. Signed-off-by: Kent Overstreet --- fs/bcachefs/buckets.c | 10 ---------- fs/bcachefs/buckets.h | 12 ------------ fs/bcachefs/buckets_types.h | 5 ----- 3 files changed, 27 deletions(-) diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index c261fa3a0273..5e2b9aa93241 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -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) { diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index ccf9813c65e7..f9d8d7b9fbd1 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -279,23 +279,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 *); diff --git a/fs/bcachefs/buckets_types.h b/fs/bcachefs/buckets_types.h index baa7e0924390..570acdf455bb 100644 --- a/fs/bcachefs/buckets_types.h +++ b/fs/bcachefs/buckets_types.h @@ -61,11 +61,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; -- 2.43.0