[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 03/19] mm: hugetlb: Expose remove_inode_hugepages
From: |
Ackerley Tng |
Subject: |
[RFC PATCH 03/19] mm: hugetlb: Expose remove_inode_hugepages |
Date: |
Tue, 6 Jun 2023 19:03:48 +0000 |
TODO may want to move this to hugetlb
Signed-off-by: Ackerley Tng <ackerleytng@google.com>
---
fs/hugetlbfs/inode.c | 3 +--
include/linux/hugetlb.h | 4 ++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 3dab50d3ed88..4f25df31ae80 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -611,8 +611,7 @@ static bool remove_inode_single_folio(struct hstate *h,
struct inode *inode,
* Note: If the passed end of range value is beyond the end of file, but
* not LLONG_MAX this routine still performs a hole punch operation.
*/
-static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
- loff_t lend)
+void remove_inode_hugepages(struct inode *inode, loff_t lstart, loff_t lend)
{
struct hstate *h = hstate_inode(inode);
struct address_space *mapping = &inode->i_data;
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 023293ceec25..1483020b412b 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -259,6 +259,8 @@ void hugetlb_unshare_all_pmds(struct vm_area_struct *vma);
void hugetlb_zero_partial_page(struct hstate *h, struct address_space *mapping,
loff_t start, loff_t end);
+void remove_inode_hugepages(struct inode *inode, loff_t lstart, loff_t lend);
+
#else /* !CONFIG_HUGETLB_PAGE */
static inline void hugetlb_dup_vma_private(struct vm_area_struct *vma)
@@ -470,6 +472,8 @@ static inline void hugetlb_unshare_all_pmds(struct
vm_area_struct *vma) { }
static inline void hugetlb_zero_partial_page(
struct hstate *h, struct address_space *mapping, loff_t start, loff_t
end) {}
+static inline void remove_inode_hugepages(struct inode *inode, loff_t lstart,
loff_t lend) {}
+
#endif /* !CONFIG_HUGETLB_PAGE */
/*
* hugepages at page global directory. If arch support
--
2.41.0.rc0.172.g3f132b7071-goog
- [RFC PATCH 00/19] hugetlb support for KVM guest_mem, Ackerley Tng, 2023/06/06
- [RFC PATCH 01/19] mm: hugetlb: Expose get_hstate_idx(), Ackerley Tng, 2023/06/06
- [RFC PATCH 03/19] mm: hugetlb: Expose remove_inode_hugepages,
Ackerley Tng <=
- [RFC PATCH 02/19] mm: hugetlb: Move and expose hugetlbfs_zero_partial_page, Ackerley Tng, 2023/06/06
- [RFC PATCH 04/19] mm: hugetlb: Decouple hstate, subpool from inode, Ackerley Tng, 2023/06/06
- [RFC PATCH 05/19] mm: hugetlb: Allow alloc_hugetlb_folio() to be parametrized by subpool and hstate, Ackerley Tng, 2023/06/06
- [RFC PATCH 06/19] mm: hugetlb: Provide hugetlb_filemap_add_folio(), Ackerley Tng, 2023/06/06
- [RFC PATCH 08/19] mm: hugetlb: Refactor restore_reserve_on_error, Ackerley Tng, 2023/06/06
- [RFC PATCH 07/19] mm: hugetlb: Refactor vma_*_reservation functions, Ackerley Tng, 2023/06/06
- [RFC PATCH 09/19] mm: hugetlb: Use restore_reserve_on_error directly in filesystems, Ackerley Tng, 2023/06/06
- [RFC PATCH 10/19] mm: hugetlb: Parametrize alloc_hugetlb_folio_from_subpool() by resv_map, Ackerley Tng, 2023/06/06
- [RFC PATCH 11/19] mm: hugetlb: Parametrize hugetlb functions by resv_map, Ackerley Tng, 2023/06/06
- [RFC PATCH 12/19] mm: truncate: Expose preparation steps for truncate_inode_pages_final, Ackerley Tng, 2023/06/06