From patchwork Tue Jul 26 14:29:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12929374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2726C04A68 for ; Tue, 26 Jul 2022 14:29:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA6D58E0003; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C56828E0001; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1DF48E0002; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A2F558E0001 for ; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7348080964 for ; Tue, 26 Jul 2022 14:29:40 +0000 (UTC) X-FDA: 79729484520.11.47B2A02 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id AE6E1400CE for ; Tue, 26 Jul 2022 14:29:38 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LsfPK0MTJzkXVQ; Tue, 26 Jul 2022 22:27:01 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Jul 2022 22:29:32 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 1/5] hugetlbfs: use helper macro SZ_1{K,M} Date: Tue, 26 Jul 2022 22:29:14 +0800 Message-ID: <20220726142918.51693-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845779; a=rsa-sha256; cv=none; b=nCJUJrQNlkCKzy7u3P/TJfZDGV3ch+o724uaHW1p0AyfSEivMtNQK4OpFiFnICRUHmlZ3p bSo50qvx/2KYgHFP9c41bqBOXwFBr0rDj67rIE4NLEQTO9bwNHiHnaJ5JYChoonj/U9mH8 lyUlRARbeuSS/4Y35s0NZi3sjuB4WUs= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658845779; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K4kSvTZU7GPnRaqm3y8kLJYKpC0PjKD7ApYev4Q/uOE=; b=WyK9izrLaDo0bHzqVTfDAluB9cMfMT8Cw91uIck0JhiyXkLER1vaDHIScKz+NgXujTbzpp 56wM5Xhu4MAVTOVvC8IWJl6tNrQwjndoBThlLA4dR//p+T6unJfGtyF8wQZBFpFWRalSm3 cl7/AGAom8D6WXJ5PtXrP91kOMbC2q0= X-Stat-Signature: ia3r37aysqsqnpfwpjmgfy389br1k9mz X-Rspamd-Queue-Id: AE6E1400CE X-Rspamd-Server: rspam08 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1658845778-529563 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor readability improvement. Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 20336cb3c040..e998c416b85f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1309,7 +1309,7 @@ static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *par ps = memparse(param->string, &rest); ctx->hstate = size_to_hstate(ps); if (!ctx->hstate) { - pr_err("Unsupported page size %lu MB\n", ps >> 20); + pr_err("Unsupported page size %lu MB\n", ps / SZ_1M); return -EINVAL; } return 0; @@ -1555,7 +1555,7 @@ static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h) } if (IS_ERR(mnt)) pr_err("Cannot mount internal hugetlbfs for page size %luK", - huge_page_size(h) >> 10); + huge_page_size(h) / SZ_1K); return mnt; } From patchwork Tue Jul 26 14:29:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12929376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B6B6C19F21 for ; Tue, 26 Jul 2022 14:29:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AABEC8E0005; Tue, 26 Jul 2022 10:29:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BDD3900002; Tue, 26 Jul 2022 10:29:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8ACAB8E0005; Tue, 26 Jul 2022 10:29:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7A7798E0001 for ; Tue, 26 Jul 2022 10:29:41 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 403F2AAEDB for ; Tue, 26 Jul 2022 14:29:41 +0000 (UTC) X-FDA: 79729484562.01.8603A80 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf31.hostedemail.com (Postfix) with ESMTP id D10EA200A4 for ; Tue, 26 Jul 2022 14:29:39 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LsfNw56LBzjX0w; Tue, 26 Jul 2022 22:26:40 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Jul 2022 22:29:32 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 2/5] hugetlbfs: remove unneeded hugetlbfs_ops forward declaration Date: Tue, 26 Jul 2022 22:29:15 +0800 Message-ID: <20220726142918.51693-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845781; a=rsa-sha256; cv=none; b=oYgyNOUgHxq3QoT5CPQf38eHxQsrca6A1yxZsBePt+74d+g67fT0Ggj6dfGr2nunjRMS11 +HhDiuoFwUlDr1NHerMz8Qtp1z1lPDQov2JdE/MVeM06MkEXQvx+nYMQiH7Qy1ZJ6yHqbV ij/aYq89TdbHMl6xSbHa4tSCaQ1a0TA= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf31.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658845781; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ftNWhZKMCyFHJuS+/lMmo6G1TIYcQUyKHeEfj9gb5Bg=; b=hmNMV04Wo0dCRrD+DfIee+af2DVC4coQV3eU/E3e1sPpZzZfPpUVN81FyxFY1VyVS5rzvP t1k6kAYrffpsbMSS9b3CJ+aNcoRVmuU70pEhk1t5y/Zt1iMFXxSY2CH/qu7W2fLqTcWLOf uHT5lnlQ0cHSvn3i59y1lS/VVAK6QJA= X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D10EA200A4 Authentication-Results: imf31.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf31.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: 48p9ihk4bude4ujqtier9nxnxc14dzbr X-HE-Tag: 1658845779-16117 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The forward declaration for hugetlbfs_ops is unnecessary. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index e998c416b85f..a10156df5726 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -40,7 +40,6 @@ #include #include -static const struct super_operations hugetlbfs_ops; static const struct address_space_operations hugetlbfs_aops; const struct file_operations hugetlbfs_file_operations; static const struct inode_operations hugetlbfs_dir_inode_operations; From patchwork Tue Jul 26 14:29:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12929375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4308C00144 for ; Tue, 26 Jul 2022 14:29:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D1B28E0002; Tue, 26 Jul 2022 10:29:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1815C8E0001; Tue, 26 Jul 2022 10:29:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC5AA900002; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C6B6B8E0002 for ; Tue, 26 Jul 2022 10:29:40 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A3CBC1A0964 for ; Tue, 26 Jul 2022 14:29:40 +0000 (UTC) X-FDA: 79729484520.11.4C133B5 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf24.hostedemail.com (Postfix) with ESMTP id B85E81800BC for ; Tue, 26 Jul 2022 14:29:39 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LsfMm1XbFzWfDD; Tue, 26 Jul 2022 22:25:40 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Jul 2022 22:29:33 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 3/5] hugetlbfs: remove unneeded header file Date: Tue, 26 Jul 2022 22:29:16 +0800 Message-ID: <20220726142918.51693-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845780; a=rsa-sha256; cv=none; b=kFCSWxn4ijmvgNayh9gu+tqDjcFhZz3RqpP7OH5nkaB84YEe3Q/pMR0gCLq/9USIABe1L9 O9vYDNiN6gXcCX88uFiKc6CzxcPhnuR90J+Y3HsRdabH+g/FsbunrGWi0QDoPfMFmtCwuy d0RlOIASKjnZqfmASf4Ruym81BLyCZQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658845780; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8EyJ9252A20F3coaQgPCeoSKkEQH2MgOjv8oA8SWkUE=; b=CHYNCwjkk6433tb91ykvExH5c3sUv2HuGq4EO2frcpYcz9Z5ZjPIwGt9Fj76Cq28aotz8Z odXflM1OEz0tRRZwg19F71ad1n5/HgKg7yBlYkTi5vFgGV0oncK3Twiy+PY+AwhQcTC2nl uJgDICXWTEmTXrJR1mSNI4KiSA5eNdI= X-Stat-Signature: 3xneyuw68qqrue1t589n8js5cjt4bg1z X-Rspamd-Queue-Id: B85E81800BC Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1658845779-348090 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The header file signal.h is unneeded now. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index a10156df5726..aa7a5b8fc724 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -11,7 +11,6 @@ #include #include -#include /* remove ASAP */ #include #include #include From patchwork Tue Jul 26 14:29:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12929378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D719DC00140 for ; Tue, 26 Jul 2022 14:29:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E9CA8E0001; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 970C3940007; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 838748E0006; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 726308E0001 for ; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3C197AB99D for ; Tue, 26 Jul 2022 14:29:42 +0000 (UTC) X-FDA: 79729484604.12.0902CEF Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf16.hostedemail.com (Postfix) with ESMTP id 7B11D1800BF for ; Tue, 26 Jul 2022 14:29:41 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LsfNy0G3Sz1M89Z; Tue, 26 Jul 2022 22:26:42 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Jul 2022 22:29:33 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 4/5] hugetlbfs: cleanup some comments in inode.c Date: Tue, 26 Jul 2022 22:29:17 +0800 Message-ID: <20220726142918.51693-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658845781; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gcVkksLaIa0daKB7qix0ii0InSJE+o9RpPioxv9G1tU=; b=nUrHNlzYawkk+HMKBfL2hVFFfIOo/ejaMqV2eISrrdMYIXfd9fNxKIp9478M+pBSSDlyCT nzwChkfBe9k6X8wgmjmC6yPwnVcpnhk6yXJptt/2pi+/GJQo6+uVQNTWeTw0frKjmlyMyi CYl0sucL6LCd5ThirArK2iep4jLZ758= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845781; a=rsa-sha256; cv=none; b=1BzDzw7e+iT7WZo8gOFsFh4UeCm1Cn4EgP0J5+NKsU5xJrxod4PspuV5mrAFiGPGIVwwp+ wsmEkTHneIN++8OUj5LSjEbovhjAXsslhHW9CkfOzffVw5OyqSceibGSM+J3F1G9BSZvrI dcoZrjN7SJqJOdgMxVxe35Q0L59v+0w= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Queue-Id: 7B11D1800BF X-Rspamd-Server: rspam05 X-Stat-Signature: 7aub1o3kaqp6motj9eksa9qruzxhua4n X-HE-Tag: 1658845781-173784 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The function generic_file_buffered_read has been renamed to filemap_read since commit 87fa0f3eb267 ("mm/filemap: rename generic_file_buffered_read to filemap_read"). Update the corresponding comment. And duplicated taken in hugetlbfs_fill_super is removed. Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index aa7a5b8fc724..96c60aa3ab47 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -313,8 +313,7 @@ hugetlbfs_read_actor(struct page *page, unsigned long offset, /* * Support for read() - Find the page attached to f_mapping and copy out the - * data. Its *very* similar to generic_file_buffered_read(), we can't use that - * since it has PAGE_SIZE assumptions. + * data. This provides functionality similar to filemap_read(). */ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to) { @@ -1383,7 +1382,7 @@ hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc) /* * Allocate and initialize subpool if maximum or minimum size is * specified. Any needed reservations (for minimum size) are taken - * taken when the subpool is created. + * when the subpool is created. */ if (ctx->max_hpages != -1 || ctx->min_hpages != -1) { sbinfo->spool = hugepage_new_subpool(ctx->hstate, From patchwork Tue Jul 26 14:29:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12929379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86783C00144 for ; Tue, 26 Jul 2022 14:29:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1BC3940008; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA34C940007; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C101B940009; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id ACF3E940008 for ; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8604EA05EA for ; Tue, 26 Jul 2022 14:29:42 +0000 (UTC) X-FDA: 79729484604.16.E9F2592 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf28.hostedemail.com (Postfix) with ESMTP id 7FF0EC00AD for ; Tue, 26 Jul 2022 14:29:40 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LsfNy3SFrz1M89q; Tue, 26 Jul 2022 22:26:42 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Jul 2022 22:29:34 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 5/5] hugetlbfs: fix inaccurate comment in hugetlbfs_statfs() Date: Tue, 26 Jul 2022 22:29:18 +0800 Message-ID: <20220726142918.51693-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845781; a=rsa-sha256; cv=none; b=tJKo8cjXb6R4ttqJ/vxhREfTubQOwF+W7P9VVL/hPX+UZMh0jv76VHpHpMkN2iooken/Iz aRULq2HX+BbYw0VJiJ662ap4kuMDs6TZTb/q++sqDS3w67HIfE2RHdi5h9+RKy5WuwOPV+ 8UZNIpIz6di7NNOUcXgJWY3YjFi/Xzs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658845781; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m6KdYVFGUbU6VdoR9jLjv+Ul8sm1sD6C1+E8PC41iJU=; b=yfYAqzWtaQKt+aOPPg/q+xqeOwhwZRZ7mGhwOUDy/3aKl+7lrNGS9yDpRQV6ZVCwZMgCbO EI+z0s7hE/BUwRIvCBwxsfWHx9efY3zgvfbXwbhjXOs8tKFKkEOuNzTW79kaOYpYHQF9yj 6kCsJ8PXaAm1A2GYlGq1d9du7xZkoOo= Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: nhjynrsfgynob1zz1gjfooha3dzy3fds X-Rspamd-Queue-Id: 7FF0EC00AD X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1658845780-24413 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In some cases, e.g. when size option is not specified, f_blocks, f_bavail and f_bfree will be set to -1 instead of 0. Likewise, when nr_inodes isn't specified, f_files and f_ffree will be set to -1 too. Update the comment to make this clear. Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song --- fs/hugetlbfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 96c60aa3ab47..fe0e374b02a3 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1079,7 +1079,7 @@ static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bsize = huge_page_size(h); if (sbinfo) { spin_lock(&sbinfo->stat_lock); - /* If no limits set, just report 0 for max/free/used + /* If no limits set, just report 0 or -1 for max/free/used * blocks, like simple_statfs() */ if (sbinfo->spool) { long free_pages;