Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp261665pxf; Wed, 31 Mar 2021 23:58:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKBkg2HYD9CJ0R56latbwqjdvyh71oTbJAyH5s3DpbbvXZ7eufo/AZnvomeIBBcJZ192MH X-Received: by 2002:a17:906:2312:: with SMTP id l18mr7843216eja.468.1617260310476; Wed, 31 Mar 2021 23:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617260310; cv=none; d=google.com; s=arc-20160816; b=qR+yUEazf1qINjMHx93egYjhUMQAjp20v107+2N1/OR2Z8XoTDJs7KS3eM5g+ZUmd3 c7inJxMd6y/f3530+dJ3tmIhBoKg/sslBn97N/V1JoDisOvoHtfBSN5VTVYARxJAo5Yn L4KjA4FwZIIvS0nfoqRcviC76MNEPwEq/dlqbskj5mxKAprB633f6NcRnVbDhc/biaTJ E+WuCLfZoZW6kZLU+PZeC4MTxiiK3xNbEs/DbTmK9a4ZsLGv9zkb95/flhfI3t5Usu2l 69X8aeLGrGbhCYffFNsZJjUeEGDMRIhOevaq7eSLSr8zGr+blXhm2LI3qtfFTfo8RzlC GfIQ== 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=ksS6dXn5l8suJ61NlJA3ncv5lt/kVCC9h6owaIwmh80=; b=Es2dfsHtgEhJkFd7UHinLUgkFgMzXTOcy7KoF7Mbk1OZk2d3zOG6wuMojwQKZHYaI1 IThwmJSPMK7TmQtkGzOLI8sbEXEEJ8zD7DIlss6aQ1nDUNTcIlDBT+aTAVPL/oRfwTZb t+O4uLaLKbMU0j/b3+xzGB4E6cY2EFLHg6LBsyjFHV21/DIRJ7N5MPW9V8E1j5VZjKuc hJEfYwXT1pO0uv0U+lBDxfypZsv4GQd3Kb/+GFf4Lvj6OGG211Unff3Jkk59YYhy/JkC K8CHvl6xRmM3ZWylbcUeQtmfjFiIOix8d/HjXUVWVISNRLPx5UTg8DhQYLgBKVQajRnA 3egg== ARC-Authentication-Results: i=1; mx.google.com; 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; 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 dh14si3510018edb.334.2021.03.31.23.58.08; Wed, 31 Mar 2021 23:58:30 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbhDAG5E (ORCPT + 99 others); Thu, 1 Apr 2021 02:57:04 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15062 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbhDAG4t (ORCPT ); Thu, 1 Apr 2021 02:56:49 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F9v6m2flYzPnNb; Thu, 1 Apr 2021 14:54:08 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Thu, 1 Apr 2021 14:56:38 +0800 From: Shaokun Zhang To: , CC: Yang Guo , Alexander Viro , Shaokun Zhang Subject: [PATCH] fs/buffer.c: Delete redundant uptodate check for buffer Date: Thu, 1 Apr 2021 14:57:02 +0800 Message-ID: <1617260222-13797-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-kernel@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: Alexander Viro Signed-off-by: Yang Guo Signed-off-by: Shaokun Zhang --- fs/buffer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 673cfbef9eec..2c0d0b3f3203 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2055,8 +2055,7 @@ int __block_write_begin_int(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; } @@ -2088,8 +2087,7 @@ int __block_write_begin_int(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