From patchwork Wed Apr 10 13:28:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Yi X-Patchwork-Id: 13624550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FE6FCD1299 for ; Wed, 10 Apr 2024 13:37:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27B986B00A0; Wed, 10 Apr 2024 09:37:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 252A76B00A1; Wed, 10 Apr 2024 09:37:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C9DE6B00A2; Wed, 10 Apr 2024 09:37:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E08476B00A0 for ; Wed, 10 Apr 2024 09:37:03 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B4F08A0736 for ; Wed, 10 Apr 2024 13:37:03 +0000 (UTC) X-FDA: 81993723126.15.33E3405 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf08.hostedemail.com (Postfix) with ESMTP id 5030E16000B for ; Wed, 10 Apr 2024 13:37:00 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of yi.zhang@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=yi.zhang@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712756222; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LEsKMnu4ZxGTSHADa+88HaCdv8sKMA3qv/R1KjbnuXU=; b=fOrDktD0E/1nr4//R8EIRj0+EMZ2UXPTviCdTf2kBLPyLGvAxUnjRpwFQArTh80MRgxfwq P0pwk47bo4+aQNM6o786IaggAdLbjo0qY7Ua2tlRwfV7DCxar3rCIy8eHAF2EN5Dc/WdkT Pu8AElaoWMTVCBhtvcJmfcM1kdGRjvs= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf08.hostedemail.com: domain of yi.zhang@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=yi.zhang@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712756222; a=rsa-sha256; cv=none; b=BrDKDBDC3lZSSxR4oClQGPgId1HCRsVvliFirwmCQkw5YFd4uxvREec4GG3sdZajxfyjj1 fNtbN4inbkfjUt6JdXGLP3OqayY2wb8oc+K/0PFmiBKVYbdD/44ayAY/P8yucZdtQy+53R WyUyjQxomhJvafP5QaS76Ravp3dq+uM= Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VF3lT2tmZz4f3jkj for ; Wed, 10 Apr 2024 21:36:53 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id CAFEF1A0572 for ; Wed, 10 Apr 2024 21:36:57 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgAn+RHolRZmeCl4Jg--.8806S20; Wed, 10 Apr 2024 21:36:57 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, ritesh.list@gmail.com, hch@infradead.org, djwong@kernel.org, willy@infradead.org, zokeefe@google.com, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com, wangkefeng.wang@huawei.com Subject: [RFC PATCH v4 16/34] ext4: drop ext4_es_delayed_clu() Date: Wed, 10 Apr 2024 21:28:00 +0800 Message-Id: <20240410132818.2812377-17-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240410132818.2812377-1-yi.zhang@huaweicloud.com> References: <20240410132818.2812377-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgAn+RHolRZmeCl4Jg--.8806S20 X-Coremail-Antispam: 1UD129KBjvJXoWxZw1fZw45Xw1xGrWrJF1rXrb_yoWrJFWDp3 43try7JrW3Xw4v9a1xtw18Xr15t3Wqk3yUGr93t3WFkFyrAr1SkFnYyryfZFyrtrWxZF1Y qFWj9a4UCF4jgFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPI14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7 IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2 kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr 0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUA rcfUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-Rspamd-Queue-Id: 5030E16000B X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 547ftc3f4hkisueai4w1pno3f5i97kte X-HE-Tag: 1712756220-757836 X-HE-Meta: U2FsdGVkX1/K8ds9nUiKwowllQ7uDi9IwOCYX0OzpRnEv85/ax4cC9dlAa4FtTBbyzctDJ0WfPerGyrhiGKBYZChgc6YddvV2ugfbLc9eJsCHTh/jiVfAfbTJWZKnlNDoZ63QbxC/E3ecy6MBomKBan+1Ax5WsMOatpaYVS56Y5ENzWGO3pnS9DuC9saAMEv3RqXqn64VAfda4hSu7xCgGIu/3IXXzy/unnitma/wV6QXosy01sxq3dSAEkBmYA7c+41QA9YC46AwWL0CuU3NF92taAl1swGu0ZX4vN7gIYgFkxel5H16/J98MqU+j5QrAQRXYngUz1gEu0kD98vMIANriecNjr8gDFOV9N+5bETp5lI9L1yfANZ8/cCey3PiYm1h6Kp1k8xjfY6shJPR2mlsgGP91kKqVe5ptaF2w4mHoGQFpj8pv1ej1BHtFPmQYM5Y2IS8OLOqvYMIzQkyfsPIt11IpKazH/NeuSehVWfTxCjAhoSABBDNP2nK9Fd8wuHxltvYVULPFn4HedETtq/b7t4wNuc4Vhkgu1VJ5EjBCAwr4PGbwNsJZigKbCTusu6GtbZY4gpOqTcpg3wMVjmEJVQexvMOgjbhpyEP9r8b51pvEBJGu3LHm5qGMg8gjgg4tf9pZgIlkGtpCvtf9EiTlgu5JG0yQlPGH9j8EGt3v3KDSi5MW9MXU0BNaaGMPswt0KyK5MV9eVhHdOU9CmvJPmc8mLxZqMZrfey5v44hHGjV+GzUzImx5dBqapQQdpOGBrvxbCz6gpirGaAVltGEe8KKfWZYkkYf7TunNogofe7/rc81R+xADXR6efrKcuYGzhaE1N8gE2eygR4d5UoOc7Xm2oPxldeiup9Q8/yQv0pqyCX9xbk9w9n6DTTWMvmhfDCPBdQeaf+ElfH0hn9zPl7OZ+Ip/wgKNawf+zeWbsHzISRyUBJ71/9cPkThDaIPFJVYHDemtEpHdZ OEuDg0Ws CmXYwsWl5N0baXzs6in8wtsGUMEmQFcqPYBCG3AzKqysM+fF11JhdUkO2isV8sx4x38dLlXGgDUYcugZIarTTHUgMdqjBL3DTCW4xtBXXVB4/IXZH30rFPOXAcpTIWRH5PRzwQHETcZ6Du0nYsXAtK/JI/4mY2rLMJ4h6MlF9uuH7CVGSQN92xtFULGJaYtOWPhBg7Dd1d/qsj0CjMa7FEUj22XmHzUqL6CrKbTT/csL9gGtQJ7PQhWbqjRgw8B/38L9ZudtMk5SY52G1wA5UHiI11xmMi/d4/Xmu3s7kW7OrrwA3n1RkwaJEkKna1M8Aa0AuO9ZARquePoqDqeUCkfAPVw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Zhang Yi ext4_es_delayed_clu() and __es_delayed_clu() are not used, drop them. Signed-off-by: Zhang Yi --- fs/ext4/extents_status.c | 88 ---------------------------------------- fs/ext4/extents_status.h | 2 - 2 files changed, 90 deletions(-) diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index 75227f151b8f..9cac4ea57b73 100644 --- a/fs/ext4/extents_status.c +++ b/fs/ext4/extents_status.c @@ -2182,94 +2182,6 @@ void ext4_es_insert_delayed_extent(struct inode *inode, ext4_lblk_t lblk, return; } -/* - * __es_delayed_clu - count number of clusters containing blocks that - * are delayed only - * - * @inode - file containing block range - * @start - logical block defining start of range - * @end - logical block defining end of range - * - * Returns the number of clusters containing only delayed (not delayed - * and unwritten) blocks in the range specified by @start and @end. Any - * cluster or part of a cluster within the range and containing a delayed - * and not unwritten block within the range is counted as a whole cluster. - */ -static unsigned int __es_delayed_clu(struct inode *inode, ext4_lblk_t start, - ext4_lblk_t end) -{ - struct ext4_es_tree *tree = &EXT4_I(inode)->i_es_tree; - struct extent_status *es; - struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); - struct rb_node *node; - ext4_lblk_t first_lclu, last_lclu; - unsigned long long last_counted_lclu; - unsigned int n = 0; - - /* guaranteed to be unequal to any ext4_lblk_t value */ - last_counted_lclu = ~0ULL; - - es = __es_tree_search(&tree->root, start); - - while (es && (es->es_lblk <= end)) { - if (ext4_es_is_delonly(es)) { - if (es->es_lblk <= start) - first_lclu = EXT4_B2C(sbi, start); - else - first_lclu = EXT4_B2C(sbi, es->es_lblk); - - if (ext4_es_end(es) >= end) - last_lclu = EXT4_B2C(sbi, end); - else - last_lclu = EXT4_B2C(sbi, ext4_es_end(es)); - - if (first_lclu == last_counted_lclu) - n += last_lclu - first_lclu; - else - n += last_lclu - first_lclu + 1; - last_counted_lclu = last_lclu; - } - node = rb_next(&es->rb_node); - if (!node) - break; - es = rb_entry(node, struct extent_status, rb_node); - } - - return n; -} - -/* - * ext4_es_delayed_clu - count number of clusters containing blocks that - * are both delayed and unwritten - * - * @inode - file containing block range - * @lblk - logical block defining start of range - * @len - number of blocks in range - * - * Locking for external use of __es_delayed_clu(). - */ -unsigned int ext4_es_delayed_clu(struct inode *inode, ext4_lblk_t lblk, - ext4_lblk_t len) -{ - struct ext4_inode_info *ei = EXT4_I(inode); - ext4_lblk_t end; - unsigned int n; - - if (len == 0) - return 0; - - end = lblk + len - 1; - WARN_ON(end < lblk); - - read_lock(&ei->i_es_lock); - - n = __es_delayed_clu(inode, lblk, end); - - read_unlock(&ei->i_es_lock); - - return n; -} - /* * __revise_pending - makes, cancels, or leaves unchanged pending cluster * reservations for a specified block range depending diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h index 3c8e2edee5d5..5b49cb3b9aff 100644 --- a/fs/ext4/extents_status.h +++ b/fs/ext4/extents_status.h @@ -252,8 +252,6 @@ extern bool ext4_is_pending(struct inode *inode, ext4_lblk_t lblk); extern void ext4_es_insert_delayed_extent(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len, bool lclu_allocated, bool end_allocated); -extern unsigned int ext4_es_delayed_clu(struct inode *inode, ext4_lblk_t lblk, - ext4_lblk_t len); extern void ext4_clear_inode_es(struct inode *inode); #endif /* _EXT4_EXTENTS_STATUS_H */