Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp616057pxb; Sat, 16 Jan 2021 01:29:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZvjRowa8bkjWOWMglz75mkxbUjYLO6Brrx3pTGgOoCfhvGfLeLsFLUNkSE+cSoAmxdt76 X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr12911906edb.209.1610789394135; Sat, 16 Jan 2021 01:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610789394; cv=none; d=google.com; s=arc-20160816; b=iS+3MaAWqyjAcx9kTX8gSZZ7XRiA6wYBOhb2xDAB94VwBgpB3kVP7PbBaB5W6vYfFg 3LXSW5uSe0jIiALSCK1rrWEeMPJbx9rihAI1EfXrweb0/NZrG/nMedD3l5NjL8Ltl11B r1F2DgqPWAbtMbT7ZftDB7er+vmbTWPzvC05v2z4AM3Gu3tYFj3osH5ne7niR9xo1onY /bIczTkCd2JuPGB5r+AF4bTNW3/2hROAw2E9mZt54eBsTuIa88As91ZE1rzrUzN7LXD6 Md58v1JsKjnPBloV0yehjZuk4jpbkgwvwgYOwL5CdMnpeQgk207BdjLE9RAM0HwzyAx4 y3iQ== 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; bh=GLk26xvh7ZDWGN/y6jKfS5gthGRVMhB8PVlWDIZ4nkk=; b=NWuE2upkBpVg6eNMd/l65PV3Dgw98zobD4dfM1erdJOGV6Ryn8nny5BUR08131A6xb gxnudYlXrOw2kl8eLNZjwSMlS2p81rIzfInhL4sxw464XbsRdFL+4XHuUA71DCoTlzH9 NNCrWyr/fgBmUyLnVrAO/TjG+i5iETWxpMCBaZxFSZySt/lZZ7oUGrJ6WZi1NBkNi8kF TXlcr2d2jw9iJXOKEhQ8jEHCgYSLudbgDBdXv6RT1v49/bzH9iLn9HJVd8fNL8paTLW+ LC106rU1TfiiBj0TN7yHTH0E7tauXao8a63lhzrH1afwAr1wex/RS6byHt/uJC8rR/eX vJpg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si5161784edv.259.2021.01.16.01.29.29; Sat, 16 Jan 2021 01:29:54 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726402AbhAPJ1l (ORCPT + 99 others); Sat, 16 Jan 2021 04:27:41 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11101 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbhAPJ1k (ORCPT ); Sat, 16 Jan 2021 04:27:40 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DHt2R5btkz15sDT; Sat, 16 Jan 2021 17:25:51 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Sat, 16 Jan 2021 17:26:46 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] hugetlbfs: remove meaningless variable avoid_reserve Date: Sat, 16 Jan 2021 04:26:44 -0500 Message-ID: <20210116092644.42697-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The variable avoid_reserve is meaningless because we never changed its value and just passed it to alloc_huge_page(). So remove it to make code more clear that in hugetlbfs_fallocate, we never avoid reserve when alloc hugepage yet. Signed-off-by: Miaohe Lin --- fs/hugetlbfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 88751e35e69d..23ad6ed8b75f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -680,7 +680,6 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, */ struct page *page; unsigned long addr; - int avoid_reserve = 0; cond_resched(); @@ -717,7 +716,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, } /* Allocate page and add to page cache */ - page = alloc_huge_page(&pseudo_vma, addr, avoid_reserve); + page = alloc_huge_page(&pseudo_vma, addr, 0); hugetlb_drop_vma_policy(&pseudo_vma); if (IS_ERR(page)) { mutex_unlock(&hugetlb_fault_mutex_table[hash]); -- 2.19.1