Message ID | bb67552e121757dfc177acc7a99a170967c33ce8.1740562070.git.dsterba@suse.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E17FF26FA72 for <linux-btrfs@vger.kernel.org>; Wed, 26 Feb 2025 09:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740563506; cv=none; b=Y7o2C0ACLmuFE0EIWlEQUhXg0kB4DuqCC4dywF75CSYH9TYnW36EgCTQWX2dg2A9VXexwzEK0RZpiwMFz0vhNsvjzIV7WD1c6jS1NWWWLBlmqqvhsEDYzo+SLDhKoHMVbcAxoCm6HIhjGpRU98m8SvQ21xAoeIvCprx03jOssHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740563506; c=relaxed/simple; bh=AU4Tx8x4krTMUu2qW5dsWhzitnjTvouMAAV+ETU8fus=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GWfvzC4hh7iJXZmZvi53PA9ITXZXa1ByqvXZwldwsj9hmacEPgh/OObJacOc3bqx2Qc724UdNi7hF+86os9uycxGa4/7kvSOiSaKXvsaWNZhewUGlh9tvJCIdAyvihTybs4XivhMJnzzP0AA4C3kHLdYl8eh1ojZe/fgj0UvdCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=XYXKD2NQ; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=XYXKD2NQ; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="XYXKD2NQ"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="XYXKD2NQ" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 71FE51F38A; Wed, 26 Feb 2025 09:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1740563471; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ymXgOps4rh4HOrY4ouXkScvHeAWuAzhatNOv61TNFo4=; b=XYXKD2NQmEOlhfB6bJrznZTC09nMpkjvBivbScM40pmGu/XFFY11V8C4Tw9zfMR4hgi+jX Flaqmp6Wd6fs5vaPglhcOAOe6MkRDAm0l86T4fMIvNzc3dDc3UigUK9Ln8DyA8HVPcirdm iSccjZbdMZJAjYlnE0i8k5JoTgImcwc= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1740563471; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ymXgOps4rh4HOrY4ouXkScvHeAWuAzhatNOv61TNFo4=; b=XYXKD2NQmEOlhfB6bJrznZTC09nMpkjvBivbScM40pmGu/XFFY11V8C4Tw9zfMR4hgi+jX Flaqmp6Wd6fs5vaPglhcOAOe6MkRDAm0l86T4fMIvNzc3dDc3UigUK9Ln8DyA8HVPcirdm iSccjZbdMZJAjYlnE0i8k5JoTgImcwc= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6C6E513A53; Wed, 26 Feb 2025 09:51:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Q8d3Gg/kvmcrYgAAD6G6ig (envelope-from <dsterba@suse.com>); Wed, 26 Feb 2025 09:51:11 +0000 From: David Sterba <dsterba@suse.com> To: linux-btrfs@vger.kernel.org Cc: David Sterba <dsterba@suse.com> Subject: [PATCH 11/27] btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_read_tree_root() Date: Wed, 26 Feb 2025 10:51:11 +0100 Message-ID: <bb67552e121757dfc177acc7a99a170967c33ce8.1740562070.git.dsterba@suse.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <cover.1740562070.git.dsterba@suse.com> References: <cover.1740562070.git.dsterba@suse.com> Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: <linux-btrfs.vger.kernel.org> List-Subscribe: <mailto:linux-btrfs+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-btrfs+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 X-Spam-Flag: NO |
Series |
Struct btrfs_path auto cleaning conversions
|
expand
|
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index a799216aa264..ab7cbbf90af3 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1089,13 +1089,12 @@ struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root, const struct btrfs_key *key) { struct btrfs_root *root; - struct btrfs_path *path; + BTRFS_PATH_AUTO_FREE(path); path = btrfs_alloc_path(); if (!path) return ERR_PTR(-ENOMEM); root = read_tree_root_path(tree_root, path, key); - btrfs_free_path(path); return root; }
This is the trivial pattern for path auto free, initialize at the beginning and free at the end. Signed-off-by: David Sterba <dsterba@suse.com> --- fs/btrfs/disk-io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)