]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm: shmem: move shmem_huge_global_enabled() into shmem_allowable_huge_orders()
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Mon, 22 Jul 2024 05:43:19 +0000 (13:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:32 +0000 (02:02 +0100)
commit755f2188a20b192e15ff023be059e12df0d30df8
treefaf12cbc555ae80f956475a166def0711c6cffa2
parent0e2b71fc03efdf14e0f881c951f6dd5e052e511b
mm: shmem: move shmem_huge_global_enabled() into shmem_allowable_huge_orders()

[ Upstream commit 6beeab870e70b2d4f49baf6c6be9da1b61c169f8 ]

Move shmem_huge_global_enabled() into shmem_allowable_huge_orders(), so
that shmem_allowable_huge_orders() can also help to find the allowable
huge orders for tmpfs.  Moreover the shmem_huge_global_enabled() can
become static.  While we are at it, passing the vma instead of mm for
shmem_huge_global_enabled() makes code cleaner.

No functional changes.

Link: https://lkml.kernel.org/r/8e825146bb29ee1a1c7bd64d2968ff3e19be7815.1721626645.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Barry Song <21cnbao@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Lance Yang <ioworker0@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 2b0f922323cc ("mm: don't install PMD mappings when THPs are disabled by the hw/process/vma")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/shmem_fs.h
mm/huge_memory.c
mm/shmem.c