From patchwork Wed Apr 10 14:29:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Yi X-Patchwork-Id: 13624709 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 CA8A3CD1299 for ; Wed, 10 Apr 2024 14:39:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E7DA6B00A0; Wed, 10 Apr 2024 10:38:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 498A56B00A1; Wed, 10 Apr 2024 10:38:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3399F6B00A4; Wed, 10 Apr 2024 10:38:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 127296B00A0 for ; Wed, 10 Apr 2024 10:38:42 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D9540A0830 for ; Wed, 10 Apr 2024 14:38:41 +0000 (UTC) X-FDA: 81993878442.12.EBAC76C Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf22.hostedemail.com (Postfix) with ESMTP id 80D26C0007 for ; Wed, 10 Apr 2024 14:38:39 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of yi.zhang@huaweicloud.com designates 45.249.212.56 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=1712759920; 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=0rxcKPQ5/LrQnPK79juXITq+uvxJMHNX2dgcmXayv2HU+GuQfx4QxcjpggNWw6tTpvcGK0 VTuufsOK6fwV0M0qllsvOg68PCu3C5CEHw6qcxHiFEIX1cO3CI+C2SxbLw3TsuycxOkVQW wgdDbsc8zeUknh/p137K4dVTHu39nH8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of yi.zhang@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=yi.zhang@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712759920; a=rsa-sha256; cv=none; b=h8hG0YY3SLS0a+bg/uJZZi/8dtUy2H3mX/V6sB9s/GvEl9x5tyL04AcC4KlXC73VsEJUSr NflCFxB5tgqMi2ZXFeMqwmCb1VTFexWdfZz6phsrGMdSicmcBy2qbmC52ZHZLc+VRs98mg d89Lo8HtJQAkT160a+NKa2k1iTCJEQw= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VF56Y1lKTz4f3knN for ; Wed, 10 Apr 2024 22:38:29 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 18B741A0947 for ; Wed, 10 Apr 2024 22:38:36 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgAX6RFSpBZmcwR8Jg--.63000S20; Wed, 10 Apr 2024 22:38:35 +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, david@fromorbit.com, 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 22:29:30 +0800 Message-Id: <20240410142948.2817554-17-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240410142948.2817554-1-yi.zhang@huaweicloud.com> References: <20240410142948.2817554-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgAX6RFSpBZmcwR8Jg--.63000S20 X-Coremail-Antispam: 1UD129KBjvJXoWxZw1fZw45Xw1xGrWrJF1rXrb_yoWrJFWDp3 43try7JrW3Xw4v9a1xtw18Xr15t3Wqk3yUGr93t3WFkFyrAr1SkFnYyryfZFyrtrWxZF1Y qFWj9a4UCF4jgFDanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUHa14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAaw2AFwI0_Jrv_JF1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I 8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0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Bh8YMEdX99gcaW4f9ylU55UFhWK7Zyj47sGeOe5GKgQI5OU1anl0kZ3/g+I1HMm6tOronYLQ9NcpmvucRSVwlIUHCacTzgSQTuED5lKHZ/vLyOPikFddQmYkvefjfUYV9rl7p4vezymhnWxqBk33GVykpGXv1l9awUp+4CMBuce/BkG7wvfCnXOrmcRhFIkdUiZVrb8jVpzb3qCxwwMG/kt8/IFgr7uqWtz9FlbQLTugkNxrrteoNxEzIZr/q8F81yao8NXoceHVYVRJgaPXscggRwplOH76UOo0oUUAq3D7Kkyg6NrppW6GiiBPaOJpd6yazSNwc1SrR5xh8CPgHJYC9tXGXkBSQJR/z9ohX1aOxEYFhKwMi7xX4yM5nNk6QPc1IknTrbOKhdvEdNFFg8S8WU72aq6Nw/alzz5e0sx41o8X+ktA+z8akx6VESlHS7gOnZ5eHT5NjxldjuuswxZn5MiIF3ZaUyLs01vsorTqIns8MnwjMThcmpWdL6Fp4CfUyidyw3VNlsb9CitZNbE2SN3jcn6U6PocKOJU+OThlssxwHbgEBTMpBe1PfaDXxiQtLxwnap43URr XjQHMUFB wRFwlylCKlmqEwuGUtV02UThA7f6Nj9gjGtyfIcBtFDfefv2DZh5KDviaUHaAd1UOO8S/dhlHYkpchHPTV7zvjYIPKPgEbHOvcrnKmyo7bbra6asRJbTwetzA1xd3ttl3C8mXbc/e4Ny5GQp+MKM5LPz4jfrCT7h196mS/WxS52r2rYy+j1Y/byYhgv8+Hiw+HeFCL2pw+IkFm+nUr2p2UwSdnjB/kJEzBSxwd1jXqiwazCtkBy2Dvph9pq3AFnlhqm6gBoU5Ml2p1kt9tvvm2p2eGy9YvlHD5wZfLUQ8xj1cDUHc4Ik4Jmzl8503hNNS6AUW7brxLxKj3qu5nksQvYFAdQ== 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 */