Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp265326pxf; Thu, 1 Apr 2021 00:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0nCsRtaxnfMeYY41WOc36zlAxsLHYfb3tLSXLBXmSSvgcqZRxyXQIdp4kZJ7bOPAnv36w X-Received: by 2002:a17:906:1113:: with SMTP id h19mr7506281eja.478.1617260675021; Thu, 01 Apr 2021 00:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617260675; cv=none; d=google.com; s=arc-20160816; b=a4rJQMTfeHwUPP+UxhT1ndDukQn8xwy+aBFzSkG2je4gjhgtBFmYUaEHvkd8Y4uOz4 tBRjBc8ZGA9jREooV8T2RKvKs0UGmbU1y+FVKDKDQVGwVB79yOST2ZElIMwJJGY17zkQ xNtag7nqwNoQSHhcUXeZltsg47cOZC4G6iyIBuay1KxAd8nSLJvdYtSDdXHwKG1zLWhJ tXOs+5TJC0zOYoHFrgwAtJ39jRlIjVC8lDGpnUBCZgieoA/u95fgl/kGc7xu06PnGX4M P1d+Jei87RtrYrVCQhme6M2jO9csnQjbOqrTG5M/eb9F1N5cod1zgJ3wTn9NtGuF+hrC kUwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=1SL9YV/efMtoaT9bioG/F9FukXvrLcoJy+DilK8OcGU=; b=egA+OE9PSiakvWZuDEYw6Qdu1AnUaZIo0nfcVtdFUSf4TJWAbeUR4ecztD3ChSIAWM v6jLKB/AhGPQ4FhHGw6fmyTLoEdFbzJ6A5Fc2ugzWNDjyGUZVHB0+N23Oozo7Fvdwk5r j7jp/nCDZptqAsSoHEmloH1a2hpV3w4QA6emtccBPMRLt2KegxH4tEh1QifIUALDxSwS Dr6tqgp3P3jyaYJs+FmbkKJCkjzStYICLLg6duFwkkKu6kajASMLxttGk37r8UCjO+/W MD4CtxcroZpRhR8J8SeHT2rzKx/+NODNHLdx+FT3UO0/zkGYjxwNDUHVfAIKdJQbevdw ZVQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si3732847eds.501.2021.04.01.00.04.10; Thu, 01 Apr 2021 00:04:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233348AbhDAHDa (ORCPT + 99 others); Thu, 1 Apr 2021 03:03:30 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:15428 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233371AbhDAHDO (ORCPT ); Thu, 1 Apr 2021 03:03:14 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4F9vHC37BrzjXj7; Thu, 1 Apr 2021 15:01:27 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Thu, 1 Apr 2021 15:03:03 +0800 From: Shaokun Zhang To: , CC: Yang Guo , Theodore Ts'o , "Andreas Dilger" , Shaokun Zhang Subject: [PATCH] ext4: Delete redundant uptodate check for buffer Date: Thu, 1 Apr 2021 15:03:30 +0800 Message-ID: <1617260610-29770-1-git-send-email-zhangshaokun@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Yang Guo The buffer uptodate state has been checked in function set_buffer_uptodate, there is no need use buffer_uptodate before calling set_buffer_uptodate and delete it. Cc: "Theodore Ts'o" Cc: Andreas Dilger Signed-off-by: Yang Guo Signed-off-by: Shaokun Zhang --- fs/ext4/inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0948a43f1b3d..32fa3ad38797 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1066,8 +1066,7 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len, block_end = block_start + blocksize; if (block_end <= from || block_start >= to) { if (PageUptodate(page)) { - if (!buffer_uptodate(bh)) - set_buffer_uptodate(bh); + set_buffer_uptodate(bh); } continue; } @@ -1092,8 +1091,7 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len, } } if (PageUptodate(page)) { - if (!buffer_uptodate(bh)) - set_buffer_uptodate(bh); + set_buffer_uptodate(bh); continue; } if (!buffer_uptodate(bh) && !buffer_delay(bh) && -- 2.7.4