Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: convert ceph_zero_partial_page() to use a folio

Retrieve a folio from the pagecache instead of a page and operate on it.
Removes several hidden calls to compound_head() along with calls to
deprecated functions like wait_on_page_writeback() and find_lock_page().

[dan.carpenter@linaro.org: fix NULL vs IS_ERR() bug in ceph_zero_partial_page()]
Link: https://lkml.kernel.org/r/685c1424.050a0220.baa8.d6a1@mx.google.com
Link: https://lkml.kernel.org/r/20250612143443.2848197-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Xiubo Li <xiubli@redhat.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Alex Markuze <amarkuze@redhat.com>
Cc: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
7431f3a2 88b478e5

+11 -11
+11 -11
fs/ceph/file.c
··· 2530 2530 return generic_file_llseek(file, offset, whence); 2531 2531 } 2532 2532 2533 - static inline void ceph_zero_partial_page( 2534 - struct inode *inode, loff_t offset, unsigned size) 2533 + static inline void ceph_zero_partial_page(struct inode *inode, 2534 + loff_t offset, size_t size) 2535 2535 { 2536 - struct page *page; 2537 - pgoff_t index = offset >> PAGE_SHIFT; 2536 + struct folio *folio; 2538 2537 2539 - page = find_lock_page(inode->i_mapping, index); 2540 - if (page) { 2541 - wait_on_page_writeback(page); 2542 - zero_user(page, offset & (PAGE_SIZE - 1), size); 2543 - unlock_page(page); 2544 - put_page(page); 2545 - } 2538 + folio = filemap_lock_folio(inode->i_mapping, offset >> PAGE_SHIFT); 2539 + if (IS_ERR(folio)) 2540 + return; 2541 + 2542 + folio_wait_writeback(folio); 2543 + folio_zero_range(folio, offset_in_folio(folio, offset), size); 2544 + folio_unlock(folio); 2545 + folio_put(folio); 2546 2546 } 2547 2547 2548 2548 static void ceph_zero_pagecache_range(struct inode *inode, loff_t offset,