Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp148606lqj; Wed, 10 Apr 2024 06:48:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU74d16bEc4pzl4SVTs1Z50Zv6KZCje6mWyrGyxf1LUP7PoU0SZDcCbInf/eFy1E88aG6DoLfzvYCte+VDAQt3MHqzM67zxdyhqiWt/Ng== X-Google-Smtp-Source: AGHT+IGfAfTxSVOxWdwSZR/Ryxdge75HuDfPG468UKST9Zx5zlWn2loUgzLnMQ63mnltd3OpPKp7 X-Received: by 2002:a05:6512:1327:b0:515:b0be:3a42 with SMTP id x39-20020a056512132700b00515b0be3a42mr2508404lfu.33.1712756895013; Wed, 10 Apr 2024 06:48:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712756894; cv=pass; d=google.com; s=arc-20160816; b=flz/djDatOJGHtfJuOe/Z7SztJOY+GVnqzC6pKDm1PE4PBfbFuk8eMBtlMaUec4cx8 sS7eE/MYzJEvWZCg3wM5opUrCCt74zMEz/7y68ZdwlIF9yzV1utJV6qeatAO89T4U9bw 48MPk8Xz2S1vWl3CRKe7+q+6sVPo2VLTLj78txKua75payHA1u54sFUCBf4CTp5oZMpw cLWIl809qVAkBiiP4wt8RPDbzFqeITlXN+Q/vUyYUT0RClXcvlzhRosYBAWKpFg980aT YYAaWnEinmRPf5nPcQFdfxgYZ+WncCmvZRBp3c5DOe2HtWKCYdysqd2okThlje3Xp4tl 0uAg== 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; bh=LEsKMnu4ZxGTSHADa+88HaCdv8sKMA3qv/R1KjbnuXU=; fh=UhGiR19HeAIu8tzXykjZgtAKLLMPZj8YX6gPScUOsdE=; b=D3woz5t7ILILR/D/5J+tj4byoWpAT0BBDmorZqdZKBgfMxKSoPxY1ub8fs7cAT0Jl7 14SR5d3wYLhaQkokkU931yC0KUuPiO6BhPFd1iukNvz4XBzwnDr9yOHLwCokNtvHAEzD SqNk+T5BwMeEoRVMrscoh2JFRG7wGuSTSgLqZpBG8AfK1NwtKUtx65sTj0zArKs7eMoL hQ6qcBC0cv99c0fBQRiE+/OJl9/182dyIvYhL2m2/Sp1Vep9atDM9ZrmQQyaP8m7xYjU DFuSLI+Hes1gFHM35/6l9GOaEHj1/ydNZy8p0iUVoQ9wHbTwfyph0OU7Kz2NZ2SDP/FT IbcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-138622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138622-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ho30-20020a1709070e9e00b00a4e539d21f4si6010870ejc.166.2024.04.10.06.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 06:48:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-138622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138622-linux.lists.archive=gmail.com@vger.kernel.org" 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 D595D1F2B854 for ; Wed, 10 Apr 2024 13:40:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FBA416F28B; Wed, 10 Apr 2024 13:37:04 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (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 00D5216D9B7; Wed, 10 Apr 2024 13:37:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712756222; cv=none; b=TBQA52UAn0tRgxLLMwGIod0ZnXULvgqmkR/HT52SvqdjXqmK9Lm2uAt/LcDibJjbULPfmgw8alNIOFDzE8ayxQg4NV/vQbT4T+1EQsZIm8/R7bCic5jsIEqgWZc9mzq6uiK0Hw6m6q8o8E2ig1gSrPvkTUjItwRm3p+aXbff8Pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712756222; c=relaxed/simple; bh=PbVMzklWWkeB+qOFt4ZXfDH2XYddz1UOIdfWIAItkEM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r5+y1fPQyUOQk1gEiq+zG7LCws/tG/aXKz4i5yUwRp3BWYkWJOeDdUTv9tN1cyzZEG4TT4UVmMi4nVpl0LQPPOF2vd427bDUFlPe/QfPNKHQkR16hGnthPg21PaECnxr7nYnlpiBu7OyafsaH20yD3R9t6ta1BUgDyMUWVU+seI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VF3lP1lVqz4f3m6S; Wed, 10 Apr 2024 21:36:49 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id DB4CA1A016E; 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> 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-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/ 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 */ -- 2.39.2