mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-08 21:53:54 +08:00
ceph: Convert from invalidatepage to invalidate_folio
Mostly a straightforward conversion. Delete the pointer from the debugging output as this has no value. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs Tested-by: David Howells <dhowells@redhat.com> # afs
This commit is contained in:
parent
895586eb68
commit
9872f4de14
@ -121,7 +121,7 @@ static int ceph_set_page_dirty(struct page *page)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Reference snap context in page->private. Also set
|
* Reference snap context in page->private. Also set
|
||||||
* PagePrivate so that we get invalidatepage callback.
|
* PagePrivate so that we get invalidate_folio callback.
|
||||||
*/
|
*/
|
||||||
BUG_ON(PagePrivate(page));
|
BUG_ON(PagePrivate(page));
|
||||||
attach_page_private(page, snapc);
|
attach_page_private(page, snapc);
|
||||||
@ -130,37 +130,37 @@ static int ceph_set_page_dirty(struct page *page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are truncating the full page (i.e. offset == 0), adjust the
|
* If we are truncating the full folio (i.e. offset == 0), adjust the
|
||||||
* dirty page counters appropriately. Only called if there is private
|
* dirty folio counters appropriately. Only called if there is private
|
||||||
* data on the page.
|
* data on the folio.
|
||||||
*/
|
*/
|
||||||
static void ceph_invalidatepage(struct page *page, unsigned int offset,
|
static void ceph_invalidate_folio(struct folio *folio, size_t offset,
|
||||||
unsigned int length)
|
size_t length)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct ceph_inode_info *ci;
|
struct ceph_inode_info *ci;
|
||||||
struct ceph_snap_context *snapc;
|
struct ceph_snap_context *snapc;
|
||||||
|
|
||||||
inode = page->mapping->host;
|
inode = folio->mapping->host;
|
||||||
ci = ceph_inode(inode);
|
ci = ceph_inode(inode);
|
||||||
|
|
||||||
if (offset != 0 || length != thp_size(page)) {
|
if (offset != 0 || length != folio_size(folio)) {
|
||||||
dout("%p invalidatepage %p idx %lu partial dirty page %u~%u\n",
|
dout("%p invalidate_folio idx %lu partial dirty page %zu~%zu\n",
|
||||||
inode, page, page->index, offset, length);
|
inode, folio->index, offset, length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WARN_ON(!PageLocked(page));
|
WARN_ON(!folio_test_locked(folio));
|
||||||
if (PagePrivate(page)) {
|
if (folio_get_private(folio)) {
|
||||||
dout("%p invalidatepage %p idx %lu full dirty page\n",
|
dout("%p invalidate_folio idx %lu full dirty page\n",
|
||||||
inode, page, page->index);
|
inode, folio->index);
|
||||||
|
|
||||||
snapc = detach_page_private(page);
|
snapc = folio_detach_private(folio);
|
||||||
ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
|
ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
|
||||||
ceph_put_snap_context(snapc);
|
ceph_put_snap_context(snapc);
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_on_page_fscache(page);
|
folio_wait_fscache(folio);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ceph_releasepage(struct page *page, gfp_t gfp)
|
static int ceph_releasepage(struct page *page, gfp_t gfp)
|
||||||
@ -1377,7 +1377,7 @@ const struct address_space_operations ceph_aops = {
|
|||||||
.write_begin = ceph_write_begin,
|
.write_begin = ceph_write_begin,
|
||||||
.write_end = ceph_write_end,
|
.write_end = ceph_write_end,
|
||||||
.set_page_dirty = ceph_set_page_dirty,
|
.set_page_dirty = ceph_set_page_dirty,
|
||||||
.invalidatepage = ceph_invalidatepage,
|
.invalidate_folio = ceph_invalidate_folio,
|
||||||
.releasepage = ceph_releasepage,
|
.releasepage = ceph_releasepage,
|
||||||
.direct_IO = noop_direct_IO,
|
.direct_IO = noop_direct_IO,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user