From patchwork Tue Jul 18 17:39:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 122181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1922284vqt; Tue, 18 Jul 2023 11:09:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5FBt4bTiClTk9fmh2Eu+BTYT2R3V0uFWcMQSckvWqQhTXTYBSmOyVkQy8Ph9/LXkcDR5f X-Received: by 2002:a05:6402:34b:b0:51d:f7b2:e95b with SMTP id r11-20020a056402034b00b0051df7b2e95bmr381977edw.34.1689703768884; Tue, 18 Jul 2023 11:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689703768; cv=none; d=google.com; s=arc-20160816; b=Mjc7ZqodbD/ynfy4tuHiKwZP1zOqb1Y59h5enjVDt+OevrMxAwHViWf2OCFBCq985Y I+ZJfT4Bic7XzDIE+kk8inK570e2S/9T/3YHLpu/F8em0jRKviSlG6c9mZ5RgOZh+dta woBXWtojF3yDK+Tr/OktI9ua7NExxflcuMz/qWB/dbkLZUi1TaZ9i9nTSNEcdsq4eQ4h WuGdFxmRtuLjFHdDJe/OEm4Jx0Bqri1AKnxL2Vum63XY0zd4eIbiwlv6VpMPx5mVFlMP hecizGsHIPc/vUjgL82MMEpAeBbTAAmP99Xkmltb9VZDSNMyukf3OCqoEm5ygDkyA/0i /jbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=xtb9eaTW3MdBWzglgP8jPdI48OuUsG3guGiK3GgqLrA=; fh=hGZdrH2mF2/Q3AcPkfS7Nn1ztcn5Esm/AyeVaSVIQZk=; b=DaBoHF2cO4tiLkwkF4ddPhXCn1AVCxrROlmEvxFr9Cv7GSWnl2PoV+MbbxHf20Ke2r P9lLvHbF30QLiyutHYUUhvkzzlCFYD8lgIjHwb5RzKWV8B1jdykViUQbA4/ZnUmQKMg5 aucIsPWyE5s6LS0NjPPliaqMkeCNvibN9+pd/4ghgLpWXAegVKguljlQTgLFhKLinfcR 3mAdXhmjMtLRoipaMCWU7FVav+K41CcJa9eL7DA2zx0fCevinnOMXpOaANaTCepXY6eM rRuwJgwQxABl7v2LYuyE+8pAdPDxITxfwi8ounvgSI4UfUQ/x2aY/qwse5zFnNGT6O/c CqBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hDbxh5O4; dkim=neutral (no key) header.i=@suse.de header.b=sLfNylR7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by4-20020a0564021b0400b0051de3796896si1673147edb.211.2023.07.18.11.09.05; Tue, 18 Jul 2023 11:09:28 -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=pass header.i=@suse.de header.s=susede2_rsa header.b=hDbxh5O4; dkim=neutral (no key) header.i=@suse.de header.b=sLfNylR7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232642AbjGRRjU (ORCPT + 99 others); Tue, 18 Jul 2023 13:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjGRRjR (ORCPT ); Tue, 18 Jul 2023 13:39:17 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA9FF91; Tue, 18 Jul 2023 10:39:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7A4371F45F; Tue, 18 Jul 2023 17:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689701955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtb9eaTW3MdBWzglgP8jPdI48OuUsG3guGiK3GgqLrA=; b=hDbxh5O4NaGnPhPtMdibbkJC8blH5bHWStorBVQNZ0tHypLJTsYIfWjcQG3AGOtmSGm4uc Prk6LJS6jEBHVFd2KhY9l+cLrl4MY4YTH6s0VWb/se1szdgoN2wTvu6NV/+s9mQhtDVNzj gBNTJ7D0qYzftWJq4nZVtpj7HYKK2EA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689701955; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtb9eaTW3MdBWzglgP8jPdI48OuUsG3guGiK3GgqLrA=; b=sLfNylR7t6DRDCRrqTEynBTcTRXQskWErQV+1RBeZKzBF5KvkSEp1+XaTz0sWcb46QI9sy +UeiYJSabR3uC2CQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 094C713494; Tue, 18 Jul 2023 17:39:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cQ96OkLOtmRqbQAAMHmgww (envelope-from ); Tue, 18 Jul 2023 17:39:14 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id 9f98d451; Tue, 18 Jul 2023 17:39:07 +0000 (UTC) From: =?utf-8?q?Lu=C3=ADs_Henriques?= To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Lu?= =?utf-8?q?=C3=ADs_Henriques?= Subject: [PATCH] btrfs: turn unpin_extent_cache() into a void function Date: Tue, 18 Jul 2023 18:39:06 +0100 Message-Id: <20230718173906.12568-1-lhenriques@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771782819273443774 X-GMAIL-MSGID: 1771782819273443774 The value of the 'ret' variable is never changed in function unpin_extent_cache(). And since the only caller of this function doesn't check the return value, it can simply be turned into a void function. Signed-off-by: Luís Henriques --- fs/btrfs/extent_map.c | 7 ++----- fs/btrfs/extent_map.h | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 0cdb3e86f29b..f99c458071a4 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -292,10 +292,9 @@ 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, - u64 gen) +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, + u64 gen) { - int ret = 0; struct extent_map *em; bool prealloc = false; @@ -327,8 +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 ret; - } void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em) 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);