Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1124342ybt; Tue, 7 Jul 2020 08:18:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOwicG3zlg8r9AIDLjxvyzBMyNLL4VWupm5vxWM0lwL87NUrBJyuDz7ooe/5pz/JmmuA8K X-Received: by 2002:a50:b065:: with SMTP id i92mr65477571edd.112.1594135101880; Tue, 07 Jul 2020 08:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594135101; cv=none; d=google.com; s=arc-20160816; b=sILNYayBhnTPte7Vwdzncv2a3dUpMPQhi+2lv1MeU/fcek0KGCSN9O2HueLPE7kA2j qE6fYxAlHvoQE6rjDPO8yCffvPZw+muZcMOAGWyeG4vRnqibuf4rU8fekAtHW8SgRUwW fKgqpoN0r/4uRD9YwLBAMkdctaNGnONa3C32A63uk8Shgl1CFahFC7ctktxOjVQsxYVY crxi+JV+TernAALgmEOuurfLww1K03bH+v7cPSC7DI2IAolNKmwJdpu8IAlAyyE+uE4j nWd1ntD+gVm2JDJEHaRaqkWg6UrOYdM6kTpUaT64E1tRqL70p31NAuGDMgw202hLeoH8 1lSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=72IEqGttcziLGjg2/vHyBHar9ojJEaMyI1s8bPcGZ90=; b=MR5HDd2/zut+bfk4jBetqC/RPcbGkziZrp6J4ScSCsDVzwChr8HXdRvW5vM3Ob4f+1 6vyFxpHioQ6c/bcjK3E7mSmwH0tWpV6wndUMOvR2ke8KONoQzhbItSY+Xx1R396QXZa0 iG0mN26oKwo9OM2koBNIu4svvOn/ssaTlXTYfppdioAtW36GyVBaI959xUXCTlSkBkGs yZYidRk6UiquSeQVIY760zCvMLCWkRBfcQr9p/ZCMBFT63BD4gotgULPRwbkPFirMH7i zgIE5ROUfCjrwaxJOk9Hrjc+/WaDgljmjHNiMDwMvWNeWHZPwMMTHxReZkIBp2tC0OT/ ph5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PQChIv2a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si6493225ejb.452.2020.07.07.08.17.59; Tue, 07 Jul 2020 08:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PQChIv2a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728970AbgGGPQY (ORCPT + 99 others); Tue, 7 Jul 2020 11:16:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:55714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728961AbgGGPQW (ORCPT ); Tue, 7 Jul 2020 11:16:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9682C20674; Tue, 7 Jul 2020 15:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594134982; bh=cDVNGd8ilXWq9pqQlcKEwS0JNsU1pdG77gmqf+Zy3XU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PQChIv2a5sgebfF59oZ45m0ajz2IIjKz40lL1m2cU+0RfyGHn/ygco8tY5ng6d+6p XYOuF1zq4H2SlbSPyQdepNShyb+1AhlMsSpnoKDWaoUzyUkskU/r6sL+p8eqvu1Y9R jcWvZ5l44bQ7xEtCyb5Brs1avpV19u++GBlCTPxk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anand Jain , Nikolay Borisov , David Sterba , Sasha Levin Subject: [PATCH 4.14 02/27] btrfs: cow_file_range() num_bytes and disk_num_bytes are same Date: Tue, 7 Jul 2020 17:15:29 +0200 Message-Id: <20200707145749.068163785@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200707145748.944863698@linuxfoundation.org> References: <20200707145748.944863698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anand Jain [ Upstream commit 3752d22fcea160cc2493e34f5e0e41cdd7fdd921 ] This patch deletes local variable disk_num_bytes as its value is same as num_bytes in the function cow_file_range(). Signed-off-by: Anand Jain Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/inode.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 39ad582d72c4b..a8ae9a0704871 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -978,7 +978,6 @@ static noinline int cow_file_range(struct inode *inode, u64 alloc_hint = 0; u64 num_bytes; unsigned long ram_size; - u64 disk_num_bytes; u64 cur_alloc_size = 0; u64 blocksize = fs_info->sectorsize; struct btrfs_key ins; @@ -996,7 +995,6 @@ static noinline int cow_file_range(struct inode *inode, num_bytes = ALIGN(end - start + 1, blocksize); num_bytes = max(blocksize, num_bytes); - disk_num_bytes = num_bytes; inode_should_defrag(BTRFS_I(inode), start, end, num_bytes, SZ_64K); @@ -1023,15 +1021,14 @@ static noinline int cow_file_range(struct inode *inode, } } - BUG_ON(disk_num_bytes > - btrfs_super_total_bytes(fs_info->super_copy)); + BUG_ON(num_bytes > btrfs_super_total_bytes(fs_info->super_copy)); alloc_hint = get_extent_allocation_hint(inode, start, num_bytes); btrfs_drop_extent_cache(BTRFS_I(inode), start, start + num_bytes - 1, 0); - while (disk_num_bytes > 0) { - cur_alloc_size = disk_num_bytes; + while (num_bytes > 0) { + cur_alloc_size = num_bytes; ret = btrfs_reserve_extent(root, cur_alloc_size, cur_alloc_size, fs_info->sectorsize, 0, alloc_hint, &ins, 1, 1); @@ -1097,11 +1094,10 @@ static noinline int cow_file_range(struct inode *inode, delalloc_end, locked_page, EXTENT_LOCKED | EXTENT_DELALLOC, page_ops); - if (disk_num_bytes < cur_alloc_size) - disk_num_bytes = 0; + if (num_bytes < cur_alloc_size) + num_bytes = 0; else - disk_num_bytes -= cur_alloc_size; - num_bytes -= cur_alloc_size; + num_bytes -= cur_alloc_size; alloc_hint = ins.objectid + ins.offset; start += cur_alloc_size; extent_reserved = false; -- 2.25.1