From f98d80d51777e2c8a26efec9b86541b3b5a154ae Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Wed, 15 Jul 2026 10:38:00 +0900 Subject: [PATCH] ntfs: Inline zero_partial_compressed_page() zero_partial_compressed_page() has one caller and the next commit will make changes to it that make it inelegant to split across two functions. Fixes: 495e90fa3348 ("ntfs: update attrib operations") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- fs/ntfs/compress.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c index 76bd806b41ed..c904858dff3d 100644 --- a/fs/ntfs/compress.c +++ b/fs/ntfs/compress.c @@ -96,26 +96,6 @@ void free_compression_buffers(void) mutex_unlock(&ntfs_cb_lock); } -/* - * zero_partial_compressed_page - zero out of bounds compressed page region - * @page: page to zero - * @initialized_size: initialized size of the attribute - */ -static void zero_partial_compressed_page(struct page *page, - const s64 initialized_size) -{ - u8 *kp = page_address(page); - unsigned int kp_ofs; - - ntfs_debug("Zeroing page region outside initialized size."); - if (((s64)page->__folio_index << PAGE_SHIFT) >= initialized_size) { - clear_page(kp); - return; - } - kp_ofs = initialized_size & ~PAGE_MASK; - memset(kp + kp_ofs, 0, PAGE_SIZE - kp_ofs); -} - /* * handle_bounds_compressed_page - test for&handle out of bounds compressed page * @page: page to check and handle @@ -126,8 +106,18 @@ static inline void handle_bounds_compressed_page(struct page *page, const loff_t i_size, const s64 initialized_size) { if ((page->__folio_index >= (initialized_size >> PAGE_SHIFT)) && - (initialized_size < i_size)) - zero_partial_compressed_page(page, initialized_size); + (initialized_size < i_size)) { + u8 *kp = page_address(page); + unsigned int kp_ofs; + + ntfs_debug("Zeroing page region outside initialized size."); + if (((s64)page->__folio_index << PAGE_SHIFT) >= initialized_size) { + clear_page(kp); + return; + } + kp_ofs = initialized_size & ~PAGE_MASK; + memset(kp + kp_ofs, 0, PAGE_SIZE - kp_ofs); + } } /*