Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2316161rwd; Wed, 14 Jun 2023 00:43:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sHPLopymGHH/QZ9zniP7UEcAL0OpzMEjc2bAOyJqP+XFF19AQsrB+auft77kyKGj7eyd8 X-Received: by 2002:a05:6a00:c83:b0:64d:2c58:f86f with SMTP id a3-20020a056a000c8300b0064d2c58f86fmr1280705pfv.0.1686728605394; Wed, 14 Jun 2023 00:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686728605; cv=none; d=google.com; s=arc-20160816; b=cXtPETA1Y9kb5ZAS+PuDx1Vq7Md45zhjk0omG9xdEpWIXXJBYowgcVEhrd7A02hfyt nrf5mSA1rfRXarh3TsQVekjrY3Qv5A9x7tPj7l1KDXsSWo4mT0u2f/icuMfLtAZoMwRz qxRjE6m9ah5ZNZknpxQPBWxtDOWSh6sYy1azCXvbBR718nlBY5iFvoPFbQEim8yxqeAd 1SYjbdvcLzzEwvQwW/PG9pJ1nwM2pJZmEHI4pDQx+i+vKWOHMorjJ+he9xmoHseS3J1W GM6ONQfQ5xM/bTb7Z5KDvGumaappjMS3bXY91ii9w1dIL8RKKkTf5J53Xu62LQaLS07Q uyxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=yOL92LxpzkRzTNfD8Hw6+oi8b5R+Un4+O99GN5P5cUM=; b=ZzCkQU7aq2FulN+jj3wXz5lAndzl8cIMSRE/roTl6o+NJd5mWZO8JnC/gpBi6Dj9Y7 vXFtLltpCXqBby/qypsrZYahl/mMDjhVMa1sFnPUA7NaxUPPCjt37G1slDjzfsf83QwN vTdo6iagM/5dWB/ILCOfyXxydHuysAUfCr/rl2cLhVnj0DJNWH5TYJLBnFekRtghm/lM wyBrO84ocrKQLEkQwrL9bOsT0L3XmMZZdkKhTNWe4b6gGJj4zm/qClyQwnupllhw/82r oxlHJ00PlA4l5FqeSCzxP6hGvOXzLTrNCQcmd/xUWjOA0XE5LDGmRvHSQuRZSnuFqznN sZIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (bad version) header.i=@208.org header.s=dkim header.b=lRXg8Nks; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w66-20020a626245000000b0063b8f0a6f51si10267660pfb.117.2023.06.14.00.43.13; Wed, 14 Jun 2023 00:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=neutral (bad version) header.i=@208.org header.s=dkim header.b=lRXg8Nks; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243099AbjFNH3l (ORCPT + 99 others); Wed, 14 Jun 2023 03:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235079AbjFNH3f (ORCPT ); Wed, 14 Jun 2023 03:29:35 -0400 Received: from mail.208.org (unknown [183.242.55.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 424B11BC9 for ; Wed, 14 Jun 2023 00:29:33 -0700 (PDT) Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4QgxrV6ZJKzBQJYm for ; Wed, 14 Jun 2023 15:29:30 +0800 (CST) Authentication-Results: mail.208.org (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=208.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=208.org; h= content-transfer-encoding:content-type:message-id:user-agent :references:in-reply-to:subject:to:from:date:mime-version; s= dkim; t=1686727770; x=1689319771; bh=v5CWFfBcMe/rqPjkRkZsB9WF6E9 Nw+B3pSIn9Cr5M2c=; b=lRXg8NkscEoky/TQTG3kX/EBZZA5TLk5XvrKlZuOCto YM9icH23ivN7c6VYRs3jdhAIHCPKNOOxi9VqRnfGmfmYlh87ouXupPm0QYjSc8e/ uQxhQP1fLdesevpAJZd7oCLcT+rj8fPh+UMfAojE4riv5kooGk0RtAYprhDKAXMS bgxgWsicNZPMjbo5zumIkCCuuNNzZwXDtL0IjqOZID3e74r4tNnylHSohn+XgkoU iGKHCggjqeaqnu3k5hiYCCtshZF/5kRrTdhqWz2wLJfe9MqChK8+D7SRIJbELKLe 9fn+idByhlt14H51E43m6bukBQCggEqB4LbbQmLqoZA== X-Virus-Scanned: amavisd-new at mail.208.org Received: from mail.208.org ([127.0.0.1]) by mail.208.org (mail.208.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id cr3cbnmlAx2Z for ; Wed, 14 Jun 2023 15:29:30 +0800 (CST) Received: from localhost (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTPSA id 4QgxrV3yzVzBJLB3; Wed, 14 Jun 2023 15:29:30 +0800 (CST) MIME-Version: 1.0 Date: Wed, 14 Jun 2023 15:29:30 +0800 From: baomingtong001@208suo.com To: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: make unpin_extent_cache return void In-Reply-To: <20230614072710.34392-1-luojianhong@cdjrlc.com> References: <20230614072710.34392-1-luojianhong@cdjrlc.com> User-Agent: Roundcube Webmail Message-ID: X-Sender: baomingtong001@208suo.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RDNS_NONE,SPF_HELO_FAIL,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return value of unpin_extent_cache is always 0, and its caller does not check its return value. Signed-off-by: Mingtong Bao --- fs/btrfs/extent_map.c | 3 +-- fs/btrfs/extent_map.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index f3e9aaeb9956..845994b47998 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -292,7 +292,7 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em) * to the generation that actually added the file item to the inode so we know * we need to sync this extent when we call fsync(). */ -int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen) { struct extent_map *em; @@ -326,7 +326,6 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, free_extent_map(em); out: write_unlock(&tree->lock); - return 0; } diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index 35d27c756e08..486a8ea798c7 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h @@ -97,7 +97,7 @@ struct extent_map *alloc_extent_map(void); void free_extent_map(struct extent_map *em); int __init extent_map_init(void); void __cold extent_map_exit(void); -int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen); +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen); void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em); struct extent_map *search_extent_mapping(struct extent_map_tree *tree, u64 start, u64 len);